A lot of people don’t know, but it is possible to create files and directories directly through NERDTree.
With NERDTree open, position the cursor on the directory you want to create and press m
, then press a and type the name of the file/directory, if you put a slash /
at the end it will create a directory, if a file will not be created!
To cancel press ESC, to update NERDTree after creation press Shift + r
and for other procedures read the menu as in the image above! 😃, cool, right ?!
I use Vim.surround a lot to generate links in MarkDown and usually the word is already typed and that brought me some more work.
When you select a word, key S
and then key [
it produces this: [ word ]
, that is, it creates a space between the brackets and the word, to avoid this, instead of using the opening bracket, use the closing bracket ]
and it will produce: [word] (without spaces), to go to the end of the word just type W
in command mode 🍺.
Problems creating dynamic lists in Vim ?! No more, use Bullets.vim and let it autocomplete your lists for you:
Do you like the ease of the mouse=a
set, but also hate it 😡 when you select it in normal mode ??? Having to keep running the controller all the time is boring!
Use this function in your ~/.vimrc
or in your ~/.config/nvim/init.vim
and change the mode only by pressing F4
Simple and practical! 😃
Let’s go again with another tip for NERDTree. Upset about the way NERDTree opens the file when you click directly on it? Force it to load the buffered file with this code:
For more information see the NERDTree documentation: :h NERDTree
There are several options for automatically inserting emoji into Vim, but many of them also stress the amount of emojis.
So, to get around this problem I created Vim Simple Emoji. To install it use your favorite plugin manager, example:
And then run the command: :PluginInstall
.
And to use, insert the emoji name between two points and press the [space] button and the emoji will be displayed at the cursor position. Example:
This will result in: 😃
Want to know the name of all the available emojis? Run: :ShowEmoji
. Some names have been modified to make them more peculiar, example: :linux
: will display the penguin 🐧
Want some cool colors for the background and front for your Vim? Define yourself! For the back alter the hex of the guibg
value and for the front guifg
, example:
If you want a dark or light background, use also: set bg=dark
or set bg=light
Do you also want to highlight the current line? Easy, use: set cursorline
. 😎
And to finish today’s tips, nothing like inserting a cool unicode in your vim-airline, add the symbol: ◉ the section bar:
These tips were created based on the questions that make me like: How did you do that in your Vim? . If you have a cool question, comment!
There are some videos that I created about Vim. However, they are in Brazilian Portuguese. But if you are interested in watching, follow the videos: