" ================================================================================================ " = Basic settings ===================================== " ================================================================================================ " 开启语法高亮 syntax on " 共享剪切板 set clipboard+=unnamed " 搜索时忽略大小写 set ignorecase " 在窗口顶部和底部保留30行 set scrolloff=30 " 命令历史长度为200 set history=200
" 显示行号 set number " 显示相对行号 set relativenumber
" 输入搜索内容时就显示搜索结果 set incsearch " 搜索时高亮显示被找到的文本 set hlsearch " 在普通模式下保持英文输入法 set keep-english-in-normal
" set number relativenumber "显示行号(由于Idea中有行号显示,则vim中的显示行号就不配置了) " 在状态行显示光标位置的行号和列号 set ruler " 开启自动折行 set wrap " 设定 << 和 >> 命令移动时的宽度为4 set shiftwidth=4 " 设置tab键的宽度 set tabstop=4 " 在插入模式下,使得按退格键时可以一次删掉 4 个空格 set softtabstop=4 " 将tab替换为相应数量的空格 set expandtab " 开启新行时的智能缩进 set smartindent " 设置退格键可以删除的字符 set backspace=2 " 屏幕滚动时在光标上下方保留5行预览代码 set co=5 " 取消备份 set nobackup " 不生成临时文件 set noswapfile " 为IdeaVim插件增加自动切换为英文输入法的功能,idea 需要安装 IdeaVimExtension plugin set keep-english-in-normal " 输入一个左括号时会匹配相应的那个右括号 set showmatch " 共享剪切板 set clipboard^=unnamed,unnamedplus "set laststatus=2 "命令行为两行 " 文件编码 set fenc=utf-8 "set mouse=a "启用鼠标 " 突出显示当前行 set cursorline "set cursorcolumn "突出显示当前列 " 设置折叠方式为marker set fdm=marker
" ================================================================================================ " = No Leader Keymaps ===================================== " ================================================================================================ " 键映射,ge用于跳转到下一个错误 nmap ge <action>(GotoNextError) " 键映射,gt用于跳转到测试 nmap gt <action>(GotoTest) " 键映射,gm用于向上移动方法 nmap gm <action>(MethodUp) " last changed in current buffer(file) " 键映射,ga用于跳转到当前缓冲区的最后更改位置 nmap ga '.'
" j: add Semicolon and goto nextline⭐️ " j: 在当前行末添加分号并跳到下一行 let g:WhichKeyDesc_InsertSemicolon = "<leader>j InsertSemicolon" nmap <leader>j A;<ESC>o
" l: lsp: Language server protocol (align with neovim)⭐️ let g:WhichKeyDesc_LSP = "<leader>l LSP" " l: 重命名元素 let g:WhichKeyDesc_LSP_Rename = "<leader>lr Rename" nmap <leader>lr <action>(RenameElement)
" n: No ⭐️ " n: 取消搜索高亮 let g:WhichKeyDesc_No_Highlight = "<leader>nl NoHighlight" nmap <leader>nl :nohlsearch<CR>
" s: Show ⭐️ " s: 显示文件结构弹窗 let g:WhichKeyDesc_Show = "<leader>s Show" let g:WhichKeyDesc_Show_FileStructure = "<leader>ss ShowFileStructure" nmap <leader>ss <action>(FileStructurePopup) " s: 显示书签 let g:WhichKeyDesc_Show_Bookmarks = "<leader>sb ShowBookmarks" nmap <leader>sb <action>(ShowBookmarks)