codeblock fix
This commit is contained in:
parent
c57ee5b525
commit
c55bab23da
|
@ -58,7 +58,7 @@ For graphical vim you'll invoke `gvim`.
|
||||||
You'll probably always want to include the following in your vimrc.
|
You'll probably always want to include the following in your vimrc.
|
||||||
You can [download](./assets/vimrc_basic) the file if you want to try it out but do take the time to read the comments.
|
You can [download](./assets/vimrc_basic) the file if you want to try it out but do take the time to read the comments.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
" basic essentials
|
" basic essentials
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
|
@ -164,7 +164,7 @@ As for window navigation I add the following to my vimrc but you will probably n
|
||||||
This remaps the arrow keys, which you should **not** be using for navigation text anyway, to window navigation.
|
This remaps the arrow keys, which you should **not** be using for navigation text anyway, to window navigation.
|
||||||
If the `nnoremap` makes no sense try `:help mapping`.
|
If the `nnoremap` makes no sense try `:help mapping`.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" use the arrows for buffer navigation
|
" use the arrows for buffer navigation
|
||||||
nnoremap <down> <C-W><C-J>
|
nnoremap <down> <C-W><C-J>
|
||||||
nnoremap <up> <C-W><C-K>
|
nnoremap <up> <C-W><C-K>
|
||||||
|
@ -195,7 +195,7 @@ You have now opened up all three files in one vim but how do you switch from one
|
||||||
They are loaded in memory and are called buffers.
|
They are loaded in memory and are called buffers.
|
||||||
To list all buffers currently opened in vim you type `:buffers` and you should see a list like the one below.
|
To list all buffers currently opened in vim you type `:buffers` and you should see a list like the one below.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
:buffers
|
:buffers
|
||||||
1 "first_file.txt" line 1
|
1 "first_file.txt" line 1
|
||||||
2 # "test.service" line 1
|
2 # "test.service" line 1
|
||||||
|
@ -209,7 +209,7 @@ As you are opening and editing files in the same instance of vim you can yank an
|
||||||
Try playing around with this and make some changes to some files.
|
Try playing around with this and make some changes to some files.
|
||||||
At some point you'll be confronted with the following message.
|
At some point you'll be confronted with the following message.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
E37: No write since last change (add ! to override)
|
E37: No write since last change (add ! to override)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ This means you're trying to switch to an other buffer but you have unsaved chang
|
||||||
I like to add the following to my vimrc to automatically save a buffer upon leaving.
|
I like to add the following to my vimrc to automatically save a buffer upon leaving.
|
||||||
Do keep in mind it can be a bit dangerous to overwrite files you're not too certain about.
|
Do keep in mind it can be a bit dangerous to overwrite files you're not too certain about.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" automatically save buffers
|
" automatically save buffers
|
||||||
set autowrite
|
set autowrite
|
||||||
set autowriteall
|
set autowriteall
|
||||||
|
@ -263,7 +263,7 @@ I personally don't like the documentation jumping up and down on my screen so yo
|
||||||
Now to be able to view the documentation we'll need to install some plugins.
|
Now to be able to view the documentation we'll need to install some plugins.
|
||||||
I have not found a clean way of hiding the preview window *and* adding a shortcut to show documentation.
|
I have not found a clean way of hiding the preview window *and* adding a shortcut to show documentation.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
set completeopt-=preview
|
set completeopt-=preview
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ set completeopt-=preview
|
||||||
Vim can do a lot more than just complete python code.
|
Vim can do a lot more than just complete python code.
|
||||||
When you press `<c-x>` you'll see a menu at the bottom along these lines.
|
When you press `<c-x>` you'll see a menu at the bottom along these lines.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)
|
-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ Every `^CHARACTER` is a different mode of autocomplete!
|
||||||
Try out the `^K` one just for fun.
|
Try out the `^K` one just for fun.
|
||||||
It will probably say this the following.
|
It will probably say this the following.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
'dictionary' option is empty
|
'dictionary' option is empty
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -334,7 +334,7 @@ Without this Vundle won't work!
|
||||||
Notice the `" ADD PLUGINS HERE`; this is where we will put links to the github plugins we want to install.
|
Notice the `" ADD PLUGINS HERE`; this is where we will put links to the github plugins we want to install.
|
||||||
Vundle will take care of the installation with the `:VundleInstall` command.
|
Vundle will take care of the installation with the `:VundleInstall` command.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
" vundle essentials
|
" vundle essentials
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
|
@ -388,7 +388,7 @@ I tend to have three basic blocks in my vimrc and I would advise you to do the s
|
||||||
|
|
||||||
So all the way at the bottom of my vimrc I would add the following.
|
So all the way at the bottom of my vimrc I would add the following.
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" map a keyboard shortcut to show and hide NERDTree
|
" map a keyboard shortcut to show and hide NERDTree
|
||||||
nnoremap <C-t> :NERDTreeToggle<CR>
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
```
|
```
|
||||||
|
@ -396,14 +396,14 @@ nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
It's also nice to automatically close NERDTree when it's the last window left.
|
It's also nice to automatically close NERDTree when it's the last window left.
|
||||||
To do this we add the following (taken from the github documentation).
|
To do this we add the following (taken from the github documentation).
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
" Exit Vim if NERDTree is the only window remaining in the only tab.
|
||||||
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
|
||||||
```
|
```
|
||||||
|
|
||||||
Our full vimrc config now looks like this and can be downloaded [here](./assets/vimrc_vundle).
|
Our full vimrc config now looks like this and can be downloaded [here](./assets/vimrc_vundle).
|
||||||
|
|
||||||
```vimscript
|
```vim
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
" vundle essentials
|
" vundle essentials
|
||||||
" ----------------------------------------------------------------------------
|
" ----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue