Is there a way to configure a shortcut within my .vimrc
to automatically open a specific file in a new buffer? I have a file I frequently need to access and I would like to quickly open said file in a new buffer during a coding or writing session. I am not looking for a fuzzy search such as could be achieved with Command-T or PeepOpen, but rather a fast command to open a specific file in a new buffer. Bonus points if there is a way to control the shape of the new buffer window.
You can create a mapping like:
nmap <leader>v :e ~/.vimrc<CR>
Now if you hit \v in normal mode, it opens your .vimrc
.
Note: \ is the default leader setting, you can change with
let leader="WHATEVER_KEY_PREFIX_YOU_PREFER"
in your .vimrc
too.
If you want in a new buffer, just try:
nmap <leader>v :find ~/.vimrc<CR>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With