This commit is contained in:
veypi 2022-04-22 16:42:49 +08:00
parent 7754883738
commit 6df91b3fa5
5 changed files with 41 additions and 6 deletions

View File

@ -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 = { {

View File

@ -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)

View File

@ -3,9 +3,29 @@ require('Comment').setup()
require('nvim-autopairs').setup()
require("toggleterm").setup {
open_mapping = [[<c-\>]],
open_mapping = [[<F1>]],
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{
}

View File

@ -37,11 +37,11 @@ nnoremap H ^
" nmap <leader>q :wqa<CR>
nmap q :bdelete<CR>
nmap Q :q!<CR>
nmap q :wq!<CR>
nmap Q :wqa!<CR>
" 重新加载设置
map R :source $MYVIMRC<CR>
map R :source ~/.config/nvim/init.vim<CR>
" 全选
@ -52,6 +52,15 @@ nmap <C-a> gg<S-v>G
" nmap <Tab> :bnext<Return>
nmap <S-Tab> :BufferLineCyclePrev<CR>
nmap <Tab> :BufferLineCycleNext<CR>
nmap 1g :BufferLineGoToBuffer 1<CR>
nmap 2g :BufferLineGoToBuffer 2<CR>
nmap 3g :BufferLineGoToBuffer 3<CR>
nmap 4g :BufferLineGoToBuffer 4<CR>
nmap 5g :BufferLineGoToBuffer 5<CR>
nmap 6g :BufferLineGoToBuffer 6<CR>
nmap 7g :BufferLineGoToBuffer 7<CR>
nmap 8g :BufferLineGoToBuffer 8<CR>
nmap 9g :BufferLineGoToBuffer 9<CR>

View File

@ -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