2.1 KiB
Basics 4
-
Open a line To insert empty line below cursor and toggle insert mode type
oTo insert empty line above cursor and toggle insert mode typeO(capital o) -
Append command Normally when we insert text, its inserted before the cursor so in the word say
li. If cursor ati. and we press i then type q then we havelqiso usingafirst cursor is moved one character right and then goes to insert mode so if after usingawe type q, then we haveliq. -
Replace Mode Toggled by
R(capital R). if it is on word saytheand cursor is at beginning ieTthen when we type Say then it will becomeSaynot SayThe. NOTE: Replace mode is like Insert mode, but every typed character replaces an existing character -
Copy and paste Highlight the text to be copied. We can do this by going to visual mode by pressing
vand moving cursor to select text. Press Esc to escape visual mode. Pressyto copy andptp paste. y here stands for yank p stands for put -
Set option To alter some settings in nvim when searching to ignore case type
:set icTo turn off ignore case type:set noicTo toggle ignorecase setting:set invicNOTE: If you want to ignore case for just one search command, use\cin the phrase:/ignore\c -
Switch between windows
<C-w><C-w>means Ctrl+w 2 times -
Creating startup script Neovim is a very configurable editor. You can customise it any way you like. To start using more features create an "init.vim" file.
-
Start editing the "init.vim" file.
:call mkdir(stdpath('config'),'p'):exe 'edit' stdpath('config').'/init.vim' -
Write the file with:
:w
-
-
Auto Completion When typing any command to get the listed list of commands begining with whatever typed , press
<C-d>. Now presstabto auto-complete it. Eg: If we type:ethen pressing Ctrl+d witll list commands starting fromeand pressing tab will autocomplete with first result -
Switching between files When u have opened nvim in folder and that folder contains some files then use the relative path to access them by
:e main.cor:e Makefile