Last active
October 30, 2022 17:50
-
-
Save laszukdawid/059ae4c41f516e206832637e5215fe6f to your computer and use it in GitHub Desktop.
Vim settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Executing pathogen, which helps organise plugins | |
execute pathogen#infect() | |
"""""""""" PACKAGES """""""""" | |
set runtimepath^=~/.vim/bundle/ctrlp.vim | |
""""" SPELLCHECKER """"" | |
:map <F7> :setlocal spell! spelllang=en_gb<CR> | |
"""""""""""""""""""" | |
" Making sure some files are assigned properly | |
au BufRead,BufNewFile *.json set filetype=json | |
autocmd BufNewFile,BufRead *.stan set syntax=stan | |
autocmd Filetype javascript setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 | |
autocmd Filetype css setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 | |
autocmd Filetype html setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2 | |
" enable syntax highlighting | |
syntax enable | |
" enable all Python syntax highlighting features | |
let python_highlight_all = 1 | |
set wildmenu " visual autocompete for command menu | |
set lazyredraw " redraw only when we need to. | |
set number " show line numbers | |
set showcmd " shows cmd in bottom bar | |
set cursorline " underline current line | |
set showmatch " shows match for parathesis [] () {} | |
" highlights last inserted text | |
nnoremap gV `[v`] | |
"""""" TABS RELATED """""" | |
filetype plugin indent on " show existing tab with 4 spaces width | |
" set tabs to have 4 spaces | |
set tabstop=4 " number of visual spaces per TAB | |
set softtabstop=4 " number of spaces in tab when editing | |
set shiftwidth=4 " when 'indenting with '>', use 4 spaces | |
" indent when moving to the next line while writing code | |
set expandtab " tabs are spaces | |
set autoindent " copy indent from current line to newline | |
"""""""""""""""""""""""""" | |
"""""" SEARCH """""" | |
set incsearch " search as characeters are entered | |
set hlsearch " highlight matches | |
" macro \<space> to :nohlsearch, which turns off highlight | |
nnoremap <leader><space> :nohlsearch<CR> | |
"""""""""""""""""""" | |
""""" MOVEMENT """"" | |
" follows visual lines when moving up(j)/down(k) | |
nnoremap j gj | |
nnoremap k gk | |
"""""""""""""""""""" | |
nnoremap <leader>s :mksession<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation requires
pathogen
which, as the package's readme suggest, can be installed with the command