我正在尝试将c.vim插件包含到我的Vim中。
不知怎的,它无法识别,我将mapleader更改为,
并仍然使用\
我想,问题隐藏在我的.vimrc中,所以我会附上它。
任何帮助都将非常感谢!
"####################################################
" Basic Settings
"####################################################
"Set the Mapleader
let mapleader=","
"Setzt den Localleader
let localleader="-"
"Aktiviert Plugins
filetype plugin on
source ~/.vim/ftplugin/c.vim
"Neue Dateien werden beim erstellen gespeichert
autocmd BufNewFile * :write
"####################################################
" Various Settings
"####################################################
" Complete options (disable preview scratch window)
"set completeopt = menu, menuone, longest
" Limit popup menu height
"set pumheight = 15
" SuperTab option for context aware completion
let g:SuperTabDefaultCompletionType = "context"
" Disable auto popup, use <Tab> to autocomplete
let g:clang_complete_auto = 0
" Show clang errors in the quickfix window
let g:clang_complete_copen = 1
"Automatic VIMRC update when VIMRC is written
au! BufWritePost .vimrc source %
"####################################################
" Basic Maps
"#####################################################
"interpreting ii as <ESC>
inoremap ii <ESC>
"cnoremap jj <c-c>
",v opens .vimrc in a new window
noremap <leader>v :e $MYVIMRC<CR><C-W>
"Y yanks to the end of the line
nnoremap Y y$
"shorcut for copying line to clipboard
nnoremap <leader>y "*y
nnoremap <leader>p "*p
"word around the cursor is capitalized
inoremap <c-u> <ESC>BvWU<ESC>Ea
"H moves the cursor to the begining of the line, L to the end
nnoremap H 0
nnoremap L $
"LustyJuggler is activated with ,b
nnoremap <silent> <leader>b :LustyJuggler<CR>
"mark a word in visual mode
vnoremap <leader>a <ESC>bve
"#################################################
" C++ - Settings
"#################################################
"#################################################
" Various Settings
"################################################
"Spellcheking in German
set spelllang=de
set spellfile=~/.vim/spell.de.utf-8.add
nnoremap <leader>s :setlocal spell! spelllang=de
"Change the directory to the one of the current file
autocmd BufEnter * lcd %:p:h
答案 0 :(得分:2)
根据c.vim的帮助
更改此插件的mapleader的正确方法是设置g:C_MapLeader
这是从c.vim的帮助中复制的。 (:h csupport-usage-vim
)
Changing the default map leader '\'
-----------------------------------
The map leader can be changed by the user by setting a global variable in the
file .vimrc
let g:C_MapLeader = ','
The map leader is now a comma. The 'line end comment' command is now defined
as ',cl'. This setting will be used as a so called local leader and influences
only files with filetype 'c' and 'cpp'.
此外,您的vimrc中不需要source ~/.vim/ftplugin/c.vim
。这应该是为你完成的。