diff --git a/lua/frame/setup.lua b/lua/frame/setup.lua index 1a627d4..5e707e6 100644 --- a/lua/frame/setup.lua +++ b/lua/frame/setup.lua @@ -68,6 +68,8 @@ vim.cmd([[colorscheme gruvbox]]) vim.opt.termguicolors = true require("bufferline").setup { options = { + sort_by = 'insert_after_current', + numbers = 'ordinal', -- 左侧让出 nvim-tree 的位置 diagnostics = "nvim_lsp"; offsets = { { diff --git a/lua/plugins.lua b/lua/plugins.lua index 201f041..5f77b1b 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -43,7 +43,8 @@ return require('packer').startup(function() 'nvim-telescope/telescope.nvim', requires = { { 'nvim-lua/plenary.nvim' } } } - use {"akinsho/toggleterm.nvim"} - + use { "akinsho/toggleterm.nvim" } + use "Pocco81/AutoSave.nvim" + use 'lewis6991/gitsigns.nvim' end) diff --git a/lua/utils/setup.lua b/lua/utils/setup.lua index 653eb18..9e11326 100644 --- a/lua/utils/setup.lua +++ b/lua/utils/setup.lua @@ -3,9 +3,29 @@ require('Comment').setup() require('nvim-autopairs').setup() require("toggleterm").setup { - open_mapping = [[]], + open_mapping = [[]], hide_numbers = true, insert_mappings = true, -- whether or not the open mapping applies in insert mode terminal_mappings = true, shell = vim.o.shell, } + +require("autosave").setup { + enabled = true, + execution_message = "AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"), + events = { "BufLeave", "FocusLost"}, + conditions = { + exists = true, + filename_is_not = {}, + filetype_is_not = {}, + modifiable = true + }, + write_all_buffers = true, + on_off_commands = true, + clean_command_line_interval = 0, + debounce_delay = 135 +} + +require('gitsigns').setup{ + +} diff --git a/maps.vim b/maps.vim index eb89cee..b1483a0 100644 --- a/maps.vim +++ b/maps.vim @@ -37,11 +37,11 @@ nnoremap H ^ " nmap q :wqa -nmap q :bdelete -nmap Q :q! +nmap q :wq! +nmap Q :wqa! " 重新加载设置 -map R :source $MYVIMRC +map R :source ~/.config/nvim/init.vim " 全选 @@ -52,6 +52,15 @@ nmap ggG " nmap :bnext nmap :BufferLineCyclePrev nmap :BufferLineCycleNext +nmap 1g :BufferLineGoToBuffer 1 +nmap 2g :BufferLineGoToBuffer 2 +nmap 3g :BufferLineGoToBuffer 3 +nmap 4g :BufferLineGoToBuffer 4 +nmap 5g :BufferLineGoToBuffer 5 +nmap 6g :BufferLineGoToBuffer 6 +nmap 7g :BufferLineGoToBuffer 7 +nmap 8g :BufferLineGoToBuffer 8 +nmap 9g :BufferLineGoToBuffer 9 diff --git a/vimrc.vim b/vimrc.vim index fcdd6b7..d33e885 100644 --- a/vimrc.vim +++ b/vimrc.vim @@ -21,6 +21,9 @@ set wrap au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +" 始终显示左侧符号栏 如git error信息等 +set signcolumn=yes:2 + " 在文件外修改时自动加载 set autoread