Add Nvim-Tree

This commit is contained in:
Thomas Avé 2022-07-05 12:56:25 +02:00
parent bc8e3b019c
commit a56117492f
5 changed files with 38 additions and 3 deletions

View File

@ -21,7 +21,7 @@ local theme = lush(function()
ErrorMsg { gui="standout", bg="#cc6666", fg="#263238", }, -- ErrorMsg xxx cterm=standout ctermfg=234 ctermbg=167 gui=standout guifg=#263238 guibg=#cc6666
NvimInvalidSpacing { ErrorMsg }, -- NvimInvalidSpacing xxx links to ErrorMsg
IncSearch { gui="reverse", }, -- IncSearch xxx cterm=reverse gui=reverse
Search { bg="#f0c674", fg="#263238", }, -- Search xxx ctermfg=234 ctermbg=221 guifg=#263238 guibg=#f0c674
Search { gui="reverse" }, -- Search xxx ctermfg=234 ctermbg=221 guifg=#263238 guibg=#f0c674
QuickFixLine { Search }, -- QuickFixLine xxx links to Search
Substitute { Search }, -- Substitute xxx links to Search
TelescopePreviewMatch { Search }, -- TelescopePreviewMatch xxx links to Search
@ -67,7 +67,7 @@ local theme = lush(function()
SpellCap { gui="underline", sp="blue", fg="#81a2be", }, -- SpellCap xxx cterm=underline ctermfg=110 gui=underline guifg=#81a2be guisp=Blue
SpellRare { gui="underline", sp="magenta", fg="#b294bb", }, -- SpellRare xxx cterm=underline ctermfg=139 gui=underline guifg=#b294bb guisp=Magenta
SpellLocal { gui="underline", sp="cyan", fg="#8abeb7", }, -- SpellLocal xxx cterm=underline ctermfg=109 gui=underline guifg=#8abeb7 guisp=Cyan
Pmenu { bg="#455a64", fg="#c5c8c6", }, -- Pmenu xxx ctermfg=250 ctermbg=237 guifg=#c5c8c6 guibg=#455A64
Pmenu { bg=hsl(0, 0, 15), fg="#c5c8c6", }, -- Pmenu xxx ctermfg=250 ctermbg=237 guifg=#c5c8c6 guibg=#455A64
NormalFloat { Pmenu }, -- NormalFloat xxx links to Pmenu
PmenuSel { gui="reverse", bg="#455a64", fg="#c5c8c6", }, -- PmenuSel xxx cterm=reverse ctermfg=250 ctermbg=237 gui=reverse guifg=#c5c8c6 guibg=#455A64
PmenuSbar { bg="grey", }, -- PmenuSbar xxx ctermbg=248 guibg=Grey
@ -89,7 +89,9 @@ local theme = lush(function()
Normal { bg=hsl(255, 0, 12), fg="#c5c8c6", }, -- Normal xxx ctermfg=250 ctermbg=234 guifg=#c5c8c6 guibg=#263238
NvimSpacing { Normal }, -- NvimSpacing xxx links to Normal
TelescopeResultsFileIcon { Normal }, -- TelescopeResultsFileIcon xxx links to Normal
TelescopeNormal { Normal }, -- TelescopeNormal xxx links to Normal
TelescopeNormal { bg=hsl(0, 0, 13)}, -- TelescopeNormal xxx links to Normal
TelescopeBorder { bg=hsl(0, 0, 15), fg=hsl(0, 0, 20)}, -- TelescopeNormal xxx links to Normal
TelescopePreviewBorder { bg=hsl(0, 0, 15), fg=hsl(0, 0, 20)}, -- TelescopeNormal xxx links to Normal
TroubleText { Normal }, -- TroubleText xxx links to Normal
TroubleNormal { Normal }, -- TroubleNormal xxx links to Normal
LspInformationHighlight { Normal }, -- LspInformationHighlight xxx links to Normal

View File

@ -17,6 +17,27 @@ require('trim').setup({
require('leap').set_default_keymaps()
require('Comment').setup()
require("nvim-tree").setup({
sort_by = "case_sensitive",
sync_root_with_cwd = true,
update_focused_file = {
update_root = true,
},
view = {
adaptive_size = true,
mappings = {
list = {
{key = "cd", action = "cd"}
}
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
vim.cmd("colorscheme material")
vim.api.nvim_create_autocmd("FileType", { pattern = "make", command = [[set tabstop=8 shiftwidth=8 softtabstop=0 noexpandtab]] })

View File

@ -5,3 +5,4 @@ vim.api.nvim_set_keymap("n", "<S-k>", "<Nop>", {})
vim.api.nvim_set_keymap("n", "<C-U>", "<C-O>", { noremap = true })
vim.api.nvim_set_keymap("n", "<C-E>", "<C-U>", { noremap = true })
vim.api.nvim_set_keymap("n", "<leader><space>", ":noh<cr>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>t", ":NvimTreeFindFileToggle<cr>", { noremap = true, silent = true })

View File

@ -1,4 +1,6 @@
require('packer').startup(function(use)
use 'mbbill/undotree'
use 'airblade/vim-rooter'
use "rafamadriz/friendly-snippets"
use 'ConradIrwin/vim-bracketed-paste'
use 'Vimjas/vim-python-pep8-indent'
@ -40,4 +42,11 @@ require('packer').startup(function(use)
requires = "kyazdani42/nvim-web-devicons",
config = function() require("trouble").setup {} end
}
use {
'kyazdani42/nvim-tree.lua',
requires = {
'kyazdani42/nvim-web-devicons', -- optional, for file icons
},
tag = 'nightly' -- optional, updated every week. (see issue #1193)
}
end)

View File

@ -33,6 +33,8 @@ vim.opt.wildmode = {"longest", "list"}
vim.g.mapleader = ","
vim.g.python_highlight_all = 1
vim.wo.signcolumn = "number"
vim.g.rooter_patterns = {".git", "Makefile", "CMakeLists.txt", "build/"}
vim.g.rooter_silent_chdir = 1
-- Tab for completion
vim.g.SuperTabContextDefaultCompletionType = "<c-n>"