0

我正在尝试将 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
4

1 回答 1

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'.

你也不应该source ~/.vim/ftplugin/c.vim在你的 vimrc 中需要它。这应该为您完成。

于 2013-05-29T17:20:53.457 回答