set enc=utf-8
set fencs=utf-8,gbk,big5,cp936,gb18030,gb2312,utf-16
set fenc=utf-8
set shortmess=atI
set belloff=all
set visualbell
set t_vb=
let mapleader = "\<Space>"
inoremap jj <ESC>
xmap aa VGo1G
set clipboard+=unnamedplus
set nocompatible
set number
let g:auto_save = 1
if has('gui_running')
if has("win16") || has("win32") || has("win95") || has("win64")
set guifont=Sarasa_NF:h14
else
set guifont=Sarasa\ NF\ 14
endif
endif
set showcmd
set mouse=a
set t_Co=256
set autoindent
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set nowrap
set ruler
set cursorline
set showmatch
set history=10000
set autoread
set virtualedit=block
xmap <BS> x
set diffopt+=vertical
set backspace=2
map <leader>n :set invnumber <CR>
map <leader>w :set invwrap <CR>
map <leader>= :vsp <CR>
map <leader>- :sp <CR>
nnoremap <C-q> <ESC>:q <CR>
inoremap <C-q> <ESC>:q <CR>
inoremap <C-T> <ESC>:tabnew %<CR> i
nnoremap <C-T> <ESC>:tabnew %<CR>
inoremap <C-N> <C-O>:tabnew <CR>
nnoremap <C-N> :tabnew <CR> i
call plug#begin()
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'branch': '0.1.x' }
Plug 'nvim-telescope/telescope-fzf-native.nvim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'RRethy/vim-illuminate'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'williamboman/mason.nvim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/syntastic'
Plug 'mfussenegger/nvim-dap'
Plug 'rcarriga/nvim-dap-ui'
Plug 'theHamsta/nvim-dap-virtual-text'
Plug 'ldelossa/nvim-dap-projects'
Plug 'Mofiqul/vscode.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'ahmedkhalf/project.nvim'
Plug 'm4xshen/smartcolumn.nvim'
Plug 'nvim-lualine/lualine.nvim'
Plug 'nvim-tree/nvim-web-devicons'
Plug 'akinsho/bufferline.nvim', { 'tag': 'v3.*' }
Plug 'sindrets/winshift.nvim'
Plug 'gennaro-tedesco/nvim-peekup'
Plug 'NvChad/nvim-colorizer.lua'
Plug 'glepnir/dashboard-nvim'
Plug 'akinsho/toggleterm.nvim', {'tag' : '*'}
Plug 'numToStr/Comment.nvim'
Plug 'folke/todo-comments.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'rcarriga/nvim-notify'
Plug 'folke/noice.nvim'
Plug 'f-person/git-blame.nvim'
Plug 'sindrets/diffview.nvim'
Plug 'MattesGroeger/vim-bookmarks'
Plug 'dstein64/nvim-scrollview', { 'branch': 'main' }
Plug 'gorbit99/codewindow.nvim'
Plug 'windwp/nvim-autopairs'
Plug 'luochen1990/rainbow'
Plug 'tpope/vim-surround'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'bronson/vim-trailing-whitespace'
Plug 'godlygeek/tabular'
Plug '907th/vim-auto-save'
Plug 'folke/which-key.nvim'
call plug#end()
lua <<EOF
-- Lua:
-- For dark theme (neovim's default)
vim.o.background = 'dark'
-- For light theme
-- vim.o.background = 'light'
local c = require('vscode.colors').get_colors()
require('vscode').setup({
-- Alternatively set style in setup
-- style = 'light'
-- Enable transparent background
transparent = true,
-- Enable italic comment
italic_comments = true,
-- Disable nvim-tree background color
disable_nvimtree_bg = true,
-- Override colors (see ./lua/vscode/colors.lua)
color_overrides = {
vscFront = '#cecece',
vscBack = '#1c1c1c',
},
-- Override highlight groups (see ./lua/vscode/theme.lua)
group_overrides = {
-- this supports the same val table as vim.api.nvim_set_hl
-- use colors from this colorscheme by requiring vscode.colors!
Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true },
}
})
require('vscode').load()
EOF
" lua <<EOF
" -- Lua
" require('onedark').setup {
" -- Main options --
" style = 'dark', -- Default theme style. Choose between 'dark', 'darker', 'cool', 'deep', 'warm', 'warmer' and 'light'
" transparent = false, -- Show/hide background
" term_colors = true, -- Change terminal color as per the selected theme style
" ending_tildes = false, -- Show the end-of-buffer tildes. By default they are hidden
" cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu
" -- toggle theme style ---
" toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "<leader>ts"
" toggle_style_list = {'dark', 'darker', 'cool', 'deep', 'warm', 'warmer', 'light'}, -- List of styles to toggle between
" -- Change code style ---
" -- Options are italic, bold, underline, none
" -- You can configure multiple style with comma separated, For e.g., keywords = 'italic,bold'
" code_style = {
" comments = 'italic',
" keywords = 'none',
" functions = 'bold',
" strings = 'none',
" variables = 'none'
" },
" -- Lualine options --
" lualine = {
" transparent = false, -- lualine center bar transparency
" },
" -- Custom Highlights --
" colors = {}, -- Override default colors
" highlights = {}, -- Override highlight groups
" -- Plugins Config --
" diagnostics = {
" darker = true, -- darker colors for diagnostic
" undercurl = true, -- use undercurl instead of underline for diagnostics
" background = true, -- use background color for virtual text
" },
" }
" require('onedark').load()
" EOF
"-------------------------------------------------------------------------------
" NERDTree
"-------------------------------------------------------------------------------
"toggle panel
map <leader>e :NERDTreeToggle<CR>
let NERDTreeAutoCenter=1
let NERDTreeShowLineNumbers=1
let NERDTreeShowHidden=1
let NERDTreeWinSize=35
" 在终端启动vim时,共享NERDTree
let g:nerdtree_tabs_open_on_console_startup=1
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ "Modified" : "✹",
\ "Staged" : "✚",
\ "Untracked" : "✭",
\ "Renamed" : "➜",
\ "Unmerged" : "═",
\ "Deleted" : "✖",
\ "Dirty" : "✗",
\ "Clean" : "✔︎",
\ 'Ignored' : '☒',
\ "Unknown" : "?"
\ }
"-------------------------------------------------------------------------------
" 搜索
"-------------------------------------------------------------------------------
" 搜索时,高亮显示匹配结果。
set hlsearch
"highlight clear Search
"清除高亮
map <leader>c :nohl <CR>
" 搜索设置
set ignorecase
set incsearch
"===============================================================================
" telescope.nvim
"===============================================================================
" Dep plug
" https://github.com/nvim-telescope/telescope-fzf-native.nvim
" https://github.com/nvim-treesitter/nvim-treesitter
" https://github.com/nvim-tree/nvim-web-devicons
" Dep cli
" https://github.com/BurntSushi/ripgrep
" https://github.com/sharkdp/fd
lua << EOF
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
EOF
"===============================================================================
" telescope-fzf-native.nvim
"===============================================================================
lua << EOF
-- You dont need to set any of these options. These are the default ones. Only
-- the loading is important
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_case"
}
}
}
-- To get fzf loaded and working with telescope, you need to call
-- load_extension, somewhere after setup function:
require('telescope').load_extension('fzf')
EOF
"===============================================================================
" nvim-treesitter/nvim-treesitter
"===============================================================================
" The goal of nvim-treesitter is both to provide
" a simple and easy way to use the interface for tree-sitter in Neovim and
" to provide some basic functionality such as highlighting based on it
" :TSModuleInfo [{module}] " list information about modules state for each filetyp
" :TSUpdate {language}. To update all parsers unconditionally, use :TSUpdate all or just :TSUpdate.
lua << EOF
require('nvim-treesitter.configs').setup{
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c","cpp", "lua", "vim", "query","bash", "c_sharp","cmake","cuda", "diff","dockerfile","dot","glsl","go","html","css","scss","tsx","sql","java","javascript","typescript","vue","yaml","json","json5","latex","llvm","make","ninja","python","rust", "regex" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
EOF
lua <<EOF
-- Set up nvim-cmp.
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- Set up lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
--require('lspconfig')['<YOUR_LSP_SERVER>'].setup {
-- capabilities = capabilities
--}
EOF
"===============================================================================
" coc-nvim
"===============================================================================
" static analysis
let g:coc_global_extensions = ['coc-marketplace', 'coc-calc' ,'coc-clangd' ,'coc-cmake' ,'coc-css' ,'coc-cssmodules' ,'coc-diagnostic' ,'coc-docker' ,'coc-eslint' ,'coc-explorer' ,'coc-floaterm' ,'coc-fzf-preview' ,'coc-git' ,'coc-glslx' ,'coc-go' ,'coc-highlight' ,'coc-html' ,'coc-html-css-support' ,'coc-htmlhint' ,'coc-java' ,'coc-json' ,'coc-lists' ,'coc-ltex' ,'coc-lua' ,'coc-markdownlint' ,'coc-nav' ,'coc-omnisharp' ,'coc-pairs' ,'coc-perl' ,'coc-powershell' ,'coc-prettier' ,'coc-pyright' ,'coc-python' ,'coc-rust-analyzer' ,'coc-sh' ,'coc-snippets' ,'coc-spell-checker' ,'coc-sql' ,'coc-stylua' ,'coc-svg' ,'coc-swagger' ,'coc-syntax' ,'coc-tsserver' ,'coc-xml' ,'coc-yaml' ,'coc-yank']
":CocList marketplace
" GoTo code navigation
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" lua require("mason").setup()
lua << EOF
-- Setup language servers.
local lspconfig = require('lspconfig')
lspconfig.ccls.setup {
init_options = {
compilationDatabaseDirectory = "build";
index = {
threads = 0;
};
clang = {
excludeArgs = { "-frounding-math"} ;
};
}
}
EOF
"===============================================================================
" dap
"===============================================================================
" debug
lua <<EOF
require('nvim-dap-projects').search_project_config()
require("dapui").setup()
require("nvim-dap-virtual-text").setup()
vim.fn.sign_define('DapBreakpoint',{ text ='🟥', texthl ='', linehl ='', numhl =''})
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
vim.keymap.set('n', '<F5>', require 'dap'.continue)
vim.keymap.set('n', '<F10>', require 'dap'.step_over)
vim.keymap.set('n', '<F11>', require 'dap'.step_into)
vim.keymap.set('n', '<F12>', require 'dap'.step_out)
vim.keymap.set('n', '<F9>', require 'dap'.toggle_breakpoint)
EOF
"===============================================================================
" project.nvim
"===============================================================================
lua << EOF
require("project_nvim").setup {
-- Manual mode doesn't automatically change your root directory, so you have
-- the option to manually do so using `:ProjectRoot` command.
manual_mode = false,
-- Methods of detecting the root directory. **"lsp"** uses the native neovim
-- lsp, while **"pattern"** uses vim-rooter like glob pattern matching. Here
-- order matters: if one is not detected, the other is used as fallback. You
-- can also delete or rearangne the detection methods.
detection_methods = { "lsp", "pattern" },
-- All the patterns used to detect root dir, when **"pattern"** is in
-- detection_methods
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
-- Table of lsp clients to ignore by name
-- eg: { "efm", ... }
ignore_lsp = {},
-- Don't calculate root dir on specific directories
-- Ex: { "~/.cargo/*", ... }
exclude_dirs = {},
-- Show hidden files in telescope
show_hidden = true,
-- When set to false, you will get a message when project.nvim changes your
-- directory.
silent_chdir = true,
-- What scope to change the directory, valid options are
-- * global (default)
-- * tab
-- * win
scope_chdir = 'global',
-- Path where project.nvim will store the project history for use in
-- telescope
datapath = vim.fn.stdpath("data"),
}
EOF
"===============================================================================
" smartcolumn.nvim
"===============================================================================
lua << EOF
local config = {
colorcolumn = {"120"},
disabled_filetypes = { "help", "text", "markdown" },
custom_colorcolumn = {ruby = "120", java = { "180", "200"}},
scope = "file",
}
require("smartcolumn").setup(config)
EOF
"===============================================================================
" nvim-lualine/lualine.nvim
"===============================================================================
lua << EOF
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
EOF
"===============================================================================
" sindrets/winshift.nvim
"===============================================================================
lua <<EOF
-- Lua
require("winshift").setup({
highlight_moving_win = true, -- Highlight the window being moved
focused_hl_group = "Visual", -- The highlight group used for the moving window
moving_win_options = {
-- These are local options applied to the moving window while it's
-- being moved. They are unset when you leave Win-Move mode.
wrap = false,
cursorline = false,
cursorcolumn = false,
colorcolumn = "",
},
keymaps = {
disable_defaults = false, -- Disable the default keymaps
win_move_mode = {
["h"] = "left",
["j"] = "down",
["k"] = "up",
["l"] = "right",
["H"] = "far_left",
["J"] = "far_down",
["K"] = "far_up",
["L"] = "far_right",
["<left>"] = "left",
["<down>"] = "down",
["<up>"] = "up",
["<right>"] = "right",
["<S-left>"] = "far_left",
["<S-down>"] = "far_down",
["<S-up>"] = "far_up",
["<S-right>"] = "far_right",
},
},
---A function that should prompt the user to select a window.
---
---The window picker is used to select a window while swapping windows with
---`:WinShift swap`.
---@return integer? winid # Either the selected window ID, or `nil` to
--- indicate that the user cancelled / gave an invalid selection.
window_picker = function()
return require("winshift.lib").pick_window({
-- A string of chars used as identifiers by the window picker.
picker_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
filter_rules = {
-- This table allows you to indicate to the window picker that a window
-- should be ignored if its buffer matches any of the following criteria.
cur_win = true, -- Filter out the current window
floats = true, -- Filter out floating windows
filetype = {}, -- List of ignored file types
buftype = {}, -- List of ignored buftypes
bufname = {}, -- List of vim regex patterns matching ignored buffer names
},
---A function used to filter the list of selectable windows.
---@param winids integer[] # The list of selectable window IDs.
---@return integer[] filtered # The filtered list of window IDs.
filter_func = nil,
})
end,
})
EOF
lua << EOF
vim.opt.termguicolors = true
require("bufferline").setup{}
EOF
let g:peekup_open = '<leader>"'
lua require 'colorizer'.setup()
lua <<EOF
-- default configuration
require('illuminate').configure({
-- providers: provider used to get references in the buffer, ordered by priority
providers = {
'lsp',
'treesitter',
'regex',
},
-- delay: delay in milliseconds
delay = 100,
-- filetype_overrides: filetype specific overrides.
-- The keys are strings to represent the filetype while the values are tables that
-- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist
filetype_overrides = {},
-- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist
filetypes_denylist = {
'dirvish',
'fugitive',
},
-- filetypes_allowlist: filetypes to illuminate, this is overriden by filetypes_denylist
filetypes_allowlist = {},
-- modes_denylist: modes to not illuminate, this overrides modes_allowlist
-- See `:help mode()` for possible values
modes_denylist = {},
-- modes_allowlist: modes to illuminate, this is overriden by modes_denylist
-- See `:help mode()` for possible values
modes_allowlist = {},
-- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_denylist = {},
-- providers_regex_syntax_allowlist: syntax to illuminate, this is overriden by providers_regex_syntax_denylist
-- Only applies to the 'regex' provider
-- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
providers_regex_syntax_allowlist = {},
-- under_cursor: whether or not to illuminate under the cursor
under_cursor = true,
-- large_file_cutoff: number of lines at which to use large_file_config
-- The `under_cursor` option is disabled when this cutoff is hit
large_file_cutoff = nil,
-- large_file_config: config to use for large files (based on large_file_cutoff).
-- Supports the same keys passed to .configure
-- If nil, vim-illuminate will be disabled for large files.
large_file_overrides = nil,
-- min_count_to_highlight: minimum number of matches required to perform highlighting
min_count_to_highlight = 1,
})
EOF
lua <<EOF
require('dashboard').setup {
-- config
}
EOF
lua require("toggleterm").setup()
lua require('Comment').setup()
lua << EOF
require("todo-comments").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
EOF
lua <<EOF
require("noice").setup({
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})
EOF
lua << EOF
require("notify").setup({
background_colour = "#333333"
})
EOF
let g:gitblame_enabled = 0
highlight BookmarkSign ctermbg=NONE ctermfg=160
highlight BookmarkLine ctermbg=194 ctermfg=NONE
let g:bookmark_sign = '♥'
let g:bookmark_highlight_lines = 1
let g:bookmark_no_default_key_mappings = 1
nmap <Leader><Leader> <Plug>BookmarkToggle
nmap <Leader>i <Plug>BookmarkAnnotate
nmap <Leader>a <Plug>BookmarkShowAll
nmap <Leader>j <Plug>BookmarkNext
nmap <Leader>k <Plug>BookmarkPrev
nmap <Leader>c <Plug>BookmarkClear
nmap <Leader>x <Plug>BookmarkClearAll
nmap <Leader>kk <Plug>BookmarkMoveUp
nmap <Leader>jj <Plug>BookmarkMoveDown
nmap <Leader>g <Plug>BookmarkMoveToLine
let g:bookmark_save_per_working_dir = 1
let g:bookmark_auto_save = 1
function! g:BMBufferFileLocation(file)
let filename = 'vim-bookmarks'
let location = ''
if isdirectory(fnamemodify(a:file, ":p:h").'/.git')
let location = fnamemodify(a:file, ":p:h").'/.git'
else
let location = finddir('.git', fnamemodify(a:file, ":p:h").'/.;')
endif
if len(location) > 0
return simplify(location.'/.'.filename)
else
return simplify(fnamemodify(a:file, ":p:h").'/.'.filename)
endif
endfunction
lua <<EOF
require('scrollview').setup({
excluded_filetypes = {'nerdtree'},
current_only = true,
winblend = 75,
base = 'buffer',
column = 80
})
EOF
lua <<EOF
local codewindow = require('codewindow')
local config ={
active_in_terminals = false, -- Should the minimap activate for terminal buffers
auto_enable = false, -- Automatically open the minimap when entering a (non-excluded) buffer (accepts a table of filetypes)
exclude_filetypes = {}, -- Choose certain filetypes to not show minimap on
max_minimap_height = nil, -- The maximum height the minimap can take (including borders)
max_lines = nil, -- If auto_enable is true, don't open the minimap for buffers which have more than this many lines.
minimap_width = 20, -- The width of the text part of the minimap
use_lsp = true, -- Use the builtin LSP to show errors and warnings
use_treesitter = true, -- Use nvim-treesitter to highlight the code
use_git = true, -- Show small dots to indicate git additions and deletions
width_multiplier = 4, -- How many characters one dot represents
z_index = 1, -- The z-index the floating window will be on
show_cursor = true, -- Show the cursor position in the minimap
window_border = 'single' -- The border style of the floating window (accepts all usual options)
};
codewindow.setup(config)
codewindow.apply_default_keybinds()
EOF
"===============================================================================
" windwp/nvim-autopairs
"===============================================================================
lua << EOF
require("nvim-autopairs").setup {}
EOF
"===============================================================================
" lukas-reineke/indent-blankline.nvim
"===============================================================================
lua << EOF
require("indent_blankline").setup {
-- for example, context is off by default, use this to turn it on
show_current_context = true,
show_current_context_start = true,
}
EOF
"===============================================================================
" mouse key
"===============================================================================
lua << EOF
local wk = require("which-key")
wk.register(mappings, opts)
EOF
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
2022-03-31 Physical Device Surface Formats
2022-03-31 Physical Device Queue Family Properties
2022-03-31 Physical Device Properties Features