From 9f58d7de2015b2e443e1e486e1f34a3ed6db4e57 Mon Sep 17 00:00:00 2001 From: juan Date: Sat, 13 Nov 2021 15:29:17 +0800 Subject: [PATCH] update mappings remove and add tagbar --- lua/mappings.lua | 9 ++--- lua/pluginList.lua | 14 +++----- lua/plugins/nvim-tree.lua | 76 +++++++++++++-------------------------- lua/plugins/shade.lua | 4 --- 4 files changed, 35 insertions(+), 68 deletions(-) delete mode 100644 lua/plugins/shade.lua diff --git a/lua/mappings.lua b/lua/mappings.lua index c65de70..79a04b7 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -28,13 +28,18 @@ vim.api.nvim_set_keymap('', 'gs', ':Gitsigns toggle_signs', -- lsp stuff vim.api.nvim_buf_set_keymap(0, 'n', 'K', 'lua vim.lsp.buf.hover()', {noremap = true}) +-- toggle tagbar +vim.api.nvim_set_keymap('', 'tt', ':TagbarToggle', {silent = true}) -- toggle NvimTree vim.api.nvim_set_keymap('', '', ':NvimTreeToggle', {silent = true}) -- toggle formatter vim.api.nvim_set_keymap('', 'fm', ':Neoformat', {silent = true}) +-- toggle comment vim.api.nvim_set_keymap('', '/', ':CommentToggle', {silent = true}) +-- toggle Hop vim.api.nvim_set_keymap('', 'b', ':HopWordBC', {silent = true}) vim.api.nvim_set_keymap('', 'w', ':HopWordAC', {silent = true}) +-- telescope stuff vim.api.nvim_set_keymap('', 'tf', ':Telescope fd', {silent = true}) vim.api.nvim_set_keymap('', 'tb', ':Telescope buffers', {silent = true}) @@ -46,7 +51,3 @@ vim.api.nvim_set_keymap('', 'tdd', vim.api.nvim_set_keymap('', 'tdw', ':Telescope lsp_workspace_diagnostics', {silent = true}) -vim.api.nvim_set_keymap('', 'dt', ':lua require("dapui").toggle()', - {silent = true}) -vim.api.nvim_set_keymap('', 'de', ':lua require("dapui").eval()', - {silent = true}) diff --git a/lua/pluginList.lua b/lua/pluginList.lua index f4984aa..4503a6f 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -43,7 +43,7 @@ return require('packer').startup(function(use) -- tree sitter use { 'nvim-treesitter/nvim-treesitter', - event = "VimEnter", + event = "VimEnter", config = function() require "plugins.treesitter" end, run = ':TSUpdate' } @@ -73,7 +73,7 @@ return require('packer').startup(function(use) after = 'coq_nvim', config = function() require("coq_3p") { - {src = "nvimlua", short_name = "nLUA"}, {src = "repl"}, + {src = "nvimlua", short_name = "nLUA"}, {src = "repl"} } end @@ -120,6 +120,7 @@ return require('packer').startup(function(use) requires = {{'nvim-lua/plenary.nvim'}}, cmd = 'Telescope' } + use {'preservim/tagbar', cmd = 'TagbarToggle'} use { 'phaazon/hop.nvim', event = "VimEnter", @@ -130,11 +131,6 @@ return require('packer').startup(function(use) } -- eye-candy - use { - 'sunjon/shade.nvim', - event = "VimEnter", - config = function() require "plugins.shade" end - } use { "lukas-reineke/indent-blankline.nvim", after = {"nvim-treesitter", "nvim-base16"}, @@ -147,8 +143,8 @@ return require('packer').startup(function(use) } use { 'p00f/nvim-ts-rainbow', - after = "nvim-treesitter", - config = function() require "plugins.nvim-ts-rainbow" end + after = "nvim-treesitter", + config = function() require "plugins.nvim-ts-rainbow" end } use { 'winston0410/range-highlight.nvim', diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index 666bcb3..e317b1b 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -1,55 +1,29 @@ -- following options are the default +-- each of these are documented in `:help nvim-tree.OPTION_NAME` require'nvim-tree'.setup { - -- disables netrw completely - disable_netrw = true, - -- hijack netrw window on startup - hijack_netrw = true, - -- open the tree when running this setup function - open_on_setup = false, - -- will not open on setup if the filetype is in this list - ignore_ft_on_setup = {}, - -- closes neovim automatically when the tree is the last **WINDOW** in the view - auto_close = false, - -- opens the tree when changing/opening a new tab if the tree wasn't previously opened - open_on_tab = false, - -- hijack the cursor in the tree to put it at the start of the filename - hijack_cursor = true, - -- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually) - update_cwd = false, - -- show lsp diagnostics in the signcolumn - lsp_diagnostics = false, - -- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file - update_focused_file = { - -- enables the feature - enable = false, - -- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory - -- only relevant when `update_focused_file.enable` is true - update_cwd = false, - -- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory - -- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true - ignore_list = {} - }, - -- configuration options for the system open command (`s` in the tree by default) - system_open = { - -- the command to run this, leaving nil should work in most cases - cmd = nil, - -- the command arguments as a list - args = {} - }, - - view = { - -- width of the window, can be either a number (columns) or a string in `%` - width = 28, - -- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom' - side = 'left', - -- if true the tree will resize itself after opening a file - auto_resize = false, - mappings = { - -- custom only false will merge the list with the default mappings - -- if true, it will only use your list to set the mappings - custom_only = false, - -- list of mappings to set on the tree manually - list = {} + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = {}, + auto_close = false, + open_on_tab = false, + hijack_cursor = true, + update_cwd = false, + update_to_buf_dir = {enable = true, auto_open = true}, + diagnostics = { + enable = true, + icons = {hint = "", info = "", warning = "", error = ""} + }, + update_focused_file = {enable = false, update_cwd = false, ignore_list = {}}, + system_open = {cmd = nil, args = {}}, + filters = {dotfiles = false, custom = {}}, + view = { + width = 30, + height = 30, + hide_root_folder = false, + side = 'left', + auto_resize = false, + mappings = {custom_only = false, list = {}} } - } } + diff --git a/lua/plugins/shade.lua b/lua/plugins/shade.lua deleted file mode 100644 index 239ccce..0000000 --- a/lua/plugins/shade.lua +++ /dev/null @@ -1,4 +0,0 @@ -require'shade'.setup({ - overlay_opacity = 70, - keys = {toggle = 's'} -})