| 1 | " syntax highlighting |
| 2 | syntax on |
| 3 | |
| 4 | " todo: experiment with colour schemes |
| 5 | "colorscheme elflord |
| 6 | |
| 7 | " might help vim cope with random terminals and colours |
| 8 | " by reminding it that the background is dark |
| 9 | set background=dark |
| 10 | |
| 11 | "set expandtab converts tabs to spaces |
| 12 | |
| 13 | set ffs=unix |
| 14 | set encoding=utf-8 |
| 15 | set fileencoding=utf-8 |
| 16 | set listchars=eol:¶,tab:>-,space:.,extends:$,precedes:^ |
| 17 | set list |
| 18 | |
| 19 | " tabs are 4 spaces |
| 20 | set tabstop=4 |
| 21 | set softtabstop=4 |
| 22 | |
| 23 | " when indenting a line with >, you still want four spaces |
| 24 | set shiftwidth=4 |
| 25 | |
| 26 | "line number highlighting |
| 27 | set cursorline |
| 28 | hi CursorLine cterm=none |
| 29 | highlight CursorLineNR ctermbg=red |
| 30 | |
| 31 | " note that this doesn't work here |
| 32 | " so have to do the above instead |
| 33 | "highlight clear CursorLine |
| 34 | |
| 35 | " allow mouse to change cursor position |
| 36 | set mouse=a |
| 37 | |
| 38 | " line numbers |
| 39 | set number |
| 40 | |
| 41 | " This block here executes the Vim Explorer on startup, opening the |
| 42 | " current directory tree in a small pane to the left |
| 43 | " note that you will have to exit twice to get back to the prompt |
| 44 | " or just append a so :wqa |
| 45 | let g:netrw_banner = 0 |
| 46 | let g:netrw_liststyle = 3 |
| 47 | let g:netrw_browse_split = 4 |
| 48 | let g:netrw_altv = 1 |
| 49 | let g:netrw_winsize = 10 |
| 50 | augroup ProjectDrawer |
| 51 | autocmd! |
| 52 | " pipe wincmd w to autofocus the buffer |
| 53 | " instead of the directory tree |
| 54 | autocmd VimEnter * :Vexplore | wincmd w |
| 55 | augroup END |
| 56 | |
| 57 | " use line numbers relative to cursor position |
| 58 | " set relativenumber |
| 59 | |
| 60 | " credit https://dev.to/aturingmachine/how-i-vim-4ha6 |
| 61 |
willpower232 / my.vimrc
Last active 1 month ago