[英]Map leader not working for the c.vim plugin
我試圖將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
根據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
。 這應該為你完成。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.