DEV Community


Discussion on: I'm switching to vim!

mafflerbach profile image
mafflerbach • Edited

I see quite often in the comment "here you can use my dotfiels, vimrc etc" At this point i would recoment to take a peak in the conf, but not blindly use them, I dont linke spaceVim either. I ve added plugins, when i needed it, and not because they sound maybe usefull. If I noticed i use features often, but have to type much i create a mapping for it.

" ripgrep for the current word/WORD under cursor  
noremap <leader>a :Rg <C-r>=expand('<cword>') <CR>
noremap <leader>A :Rg <C-r>=expand('<CWORD>') <CR>

" yank in WORD into register a s or q
map <leader>1 "ayiW
map <leader>2 "syiW
map <leader>3 "qyiW

" using resgister a and s for search and replace
map <leader>rp :%s/<C-R>a/<C-R>s/g
Enter fullscreen mode Exit fullscreen mode

also strg+f in comand node is very helpfull, if you want to alter a command from the history or th ecurrent one.

You workflow has to develop and will change over the time as well you vimrc will. I compare the vimrc to underware. Its your underware, which fits to you, and you don't realy want, that somebody else shit in it.