switch nerdtree to nvim-tree.lua

This commit is contained in:
max_richter 2021-09-22 11:44:12 +02:00
parent 91c7ded024
commit 299167feb7
4 changed files with 45 additions and 31 deletions

View File

@ -1,7 +1,7 @@
# Generated by Powerlevel10k configuration wizard on 2021-08-23 at 14:33 CEST. # Generated by Powerlevel10k configuration wizard on 2021-09-16 at 15:20 CEST.
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh. # Based on romkatv/powerlevel10k/config/p10k-pure.zsh.
# Wizard options: nerdfont-complete + powerline, large icons, pure, snazzy, rpromt, # Wizard options: nerdfont-complete + powerline, small icons, pure, rpromt, 1 line,
# 1 line, compact, instant_prompt=verbose. # compact, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config. # Type `p10k configure` to generate another config.
# #
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure). # Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
@ -39,12 +39,12 @@
# Prompt colors. # Prompt colors.
local grey='242' local grey='242'
local red='#FF5C57' local red='1'
local yellow='#F3F99D' local yellow='3'
local blue='#57C7FF' local blue='4'
local magenta='#FF6AC1' local magenta='5'
local cyan='#9AEDFE' local cyan='6'
local white='#F1F1F0' local white='7'
# Left prompt segments. # Left prompt segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
@ -161,7 +161,7 @@
# - always: Trim down prompt when accepting a command line. # - always: Trim down prompt when accepting a command line.
# - same-dir: Trim down prompt when accepting a command line unless this is the first command # - same-dir: Trim down prompt when accepting a command line unless this is the first command
# typed after changing current working directory. # typed after changing current working directory.
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=off typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
# Instant prompt mode. # Instant prompt mode.
# #

View File

@ -13,11 +13,13 @@ paq:setup({verbose = true}) {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
-- Theming Plugins -- Theming Plugins
"kaicataldo/material.vim", "kaicataldo/material.vim",
"ryanoasis/vim-devicons",
"xiyaowong/nvim-transparent", "xiyaowong/nvim-transparent",
-- Layout Plugins -- Layout Plugins
"preservim/nerdtree", --"preservim/nerdtree",
"jistr/vim-nerdtree-tabs", --"unkiwii/vim-nerdtree-sync",
"kyazdani42/nvim-web-devicons",
"kyazdani42/nvim-tree.lua",
"karb94/neoscroll.nvim",
-- Code Navigation -- Code Navigation
"junegunn/fzf", "junegunn/fzf",
"nvim-lua/popup.nvim", "nvim-lua/popup.nvim",
@ -27,6 +29,7 @@ paq:setup({verbose = true}) {
-- Obsidian / Roam features -- Obsidian / Roam features
"lervag/wiki.vim", "lervag/wiki.vim",
-- Syntax / Autocomplete -- Syntax / Autocomplete
"preservim/nerdcommenter",
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"kabouzeid/nvim-lspinstall", "kabouzeid/nvim-lspinstall",
"nvim-lua/lsp-status.nvim", "nvim-lua/lsp-status.nvim",
@ -57,12 +60,15 @@ if u.has_plugin("cmp") then
-- Apply Theme -- Apply Theme
o.syntax = "enable" o.syntax = "enable"
o.termguicolors = true o.termguicolors = true
g.NERDTreeShowHidden = true --g.NERDTreeShowHidden = true
g.NERDTreeAutoDeleteBuffer = true --g.NERDTreeAutoDeleteBuffer = true
g.NERDTreeMinimalUI = true --g.NERDTreeMinimalUI = true
g.NERDTreeDirArrows = true --g.NERDTreeDirArrows = true
-- g.NERDTreeCustomOpenArgs = {file = {where = "t"}} -- g.NERDTreeCustomOpenArgs = {file = {where = "t"}}
g.nvim_tree_auto_open = 1
g.hidden = true g.hidden = true
g.filetype = true
g.material_terminal_italics = 1 g.material_terminal_italics = 1
g.material_theme_style = "darker" g.material_theme_style = "darker"
g.wiki_root = "~/Notes" g.wiki_root = "~/Notes"
@ -106,17 +112,18 @@ if u.has_plugin("cmp") then
-- Toggleterm / Lazygit setup -- Toggleterm / Lazygit setup
require "lazy-git" require "lazy-git"
-- Autocommands require("nvim-tree.view").View.winopts.signcolumn = "no"
u.create_augroup(
{
{"VimEnter", "*", "if (@% == '') | NERDTree | endif"},
{"BufEnter", "*", 'if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif'},
{"BufWinEnter", "*", "NERDTreeMirrorOpen"}
--{"BufEnter", "*", "if &modifiable | NERDTreeFind | wincmd p | endif"}
},
"Nerdtree"
)
-- Autocommands
--[[ u.create_augroup(]]
--[[{]]
--[[{"StdinReadPre", "*", "let s:std_in=1"},]]
--[[{"VimEnter", "*", "if argc() == 0 && !exists('s:std_in') | NERDTree | endif"},]]
--[[{"BufEnter", "*", 'if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif'},]]
--[[{"BufWinEnter", "*", "if getcmdwintype() == '' | silent NERDTreeMirror | endif"}]]
--[[},]]
--[["Nerdtree"]]
--[[)]]
-- Setup rest.vim -- Setup rest.vim
require("rest-nvim").setup( require("rest-nvim").setup(
{ {
@ -134,6 +141,9 @@ if u.has_plugin("cmp") then
} }
) )
-- Smooth Scrolling
require("neoscroll").setup()
-- Autocompletion Setup -- Autocompletion Setup
o.completeopt = "menuone,noselect" o.completeopt = "menuone,noselect"
require "autocomplete" require "autocomplete"

View File

@ -9,14 +9,17 @@ map("n", " ", "<Nop>", remap)
g.mapleader = " " g.mapleader = " "
map("n", "<C-p>", ":Telescope find_files<CR>", options) map("n", "<C-p>", ":Telescope find_files<CR>", options)
map("n", "<C-f>", ":Telescope grep_string<CR>", options); map("n", "<C-f>", ":Telescope grep_string<CR>", options)
map("n", "<Leader><C-f>", ":Telescope live_grep<CR>", options); map("n", "<Leader><C-f>", ":Telescope live_grep<CR>", options)
-- Navigate Buffers -- Navigate Buffers
map("n", "<C-h>", "<C-w>h", options) map("n", "<C-h>", "<C-w>h", options)
map("n", "<C-j>", "<C-w>j", options) map("n", "<C-j>", "<C-w>j", options)
map("n", "<C-k>", "<C-w>k", options) map("n", "<C-k>", "<C-w>k", options)
map("n", "<C-l>", "<C-w>l", options) map("n", "<C-l>", "<C-w>l", options)
-- Find file in NvimTree
map("n", "<C-f>", ":NvimTreeFindFile<CR><c-w>", options)
-- I aint no weak boy -- I aint no weak boy
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options) map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options)
map("n", "<Right>", ":echo 'No Right for you'<CR><dw>", options) map("n", "<Right>", ":echo 'No Right for you'<CR><dw>", options)
@ -30,7 +33,7 @@ map("n", "<Leader>r", "<cmd>lua require('rest-nvim').run()<CR>", options)
map("n", "<Leader>q", "<Esc>:q<CR>", options) map("n", "<Leader>q", "<Esc>:q<CR>", options)
-- Open Nerdtree -- Open Nerdtree
map("n", "<F6>", ":NERDTreeToggle<CR>", options) map("n", "<C-n>", ":NvimTreeToggle<CR>", options)
-- Make ctrl+s work -- Make ctrl+s work
map("n", "<C-s>", "<Esc>:w<CR>", options) map("n", "<C-s>", "<Esc>:w<CR>", options)

View File

@ -1,5 +1,6 @@
local nvim_lsp = require "lspconfig" local nvim_lsp = require "lspconfig"
local lsp_status = require("lsp-status") local lsp_status = require("lsp-status")
local utils = require("utils")
-- function to attach completion when setting up lsp -- function to attach completion when setting up lsp
local function on_attach(client) local function on_attach(client)
@ -21,7 +22,7 @@ local function on_attach(client)
buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts) buf_set_keymap("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts) buf_set_keymap("n", "<space>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", opts)
buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts) buf_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
buf_set_keymap("n", "<C-.>", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts) buf_set_keymap("n", "<space><C-f>", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts) buf_set_keymap("n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>", opts)
buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts) buf_set_keymap("n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", opts)