a few niggles with indentation.
This commit is contained in:
parent
43c80cccf4
commit
7e0e7f88b9
186
vim.link/vimrc
186
vim.link/vimrc
|
@ -8,132 +8,128 @@ set history=5000
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
|
|
||||||
"user interface stuff
|
"user interface stuff
|
||||||
"disables the autocommenting stuff.
|
"disables the autocommenting stuff.
|
||||||
set formatoptions-=o
|
set formatoptions-=o
|
||||||
set formatoptions-=r
|
set formatoptions-=r
|
||||||
set formatoptions-=c
|
set formatoptions-=c
|
||||||
|
|
||||||
"disable text wrapping via carriage returns, should only wrap visually
|
"disable text wrapping via carriage returns, should only wrap visually
|
||||||
set textwidth=0
|
set textwidth=0
|
||||||
set wrapmargin=0
|
set wrapmargin=0
|
||||||
set wrap
|
set wrap
|
||||||
set linebreak
|
set linebreak
|
||||||
set breakindent
|
set breakindent
|
||||||
|
|
||||||
"adds a ruler to the side of the screen
|
"adds a ruler to the side of the screen
|
||||||
set number
|
set number
|
||||||
|
|
||||||
"makes the ruler show how many lines away a given line is from your cursor
|
"makes the ruler show how many lines away a given line is from your cursor
|
||||||
"set relativenumber
|
"set relativenumber
|
||||||
|
|
||||||
"displays the coordinates of your cursour in the statusbar
|
"displays the coordinates of your cursour in the statusbar
|
||||||
set ruler
|
set ruler
|
||||||
|
|
||||||
"scrollofff sets the number of lines from the top or bottom of the screen before vim will scroll. sidescroll off does the same thing for the sides of the window
|
"scrollofff sets the number of lines from the top or bottom of the screen before vim will scroll. sidescroll off does the same thing for the sides of the window
|
||||||
set scrolloff=10
|
set scrolloff=10
|
||||||
set sidescrolloff=10
|
set sidescrolloff=10
|
||||||
|
|
||||||
"better command line completion
|
"better command line completion
|
||||||
set wildmenu
|
set wildmenu
|
||||||
|
|
||||||
"ignore cases in search unless you have a capital letter in the search
|
"ignore cases in search unless you have a capital letter in the search
|
||||||
set ignorecase
|
set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
|
|
||||||
"this allows putting the cursor just after the last character of the line.
|
"this allows putting the cursor just after the last character of the line.
|
||||||
"set virtualedit=onemore
|
"set virtualedit=onemore
|
||||||
|
|
||||||
"show unfinished commands on the RIGHT side of the statusbar. yes, it is working.
|
"show unfinished commands on the RIGHT side of the statusbar. yes, it is working.
|
||||||
set showcmd
|
set showcmd
|
||||||
|
|
||||||
"make regex a bit easier to type
|
"make regex a bit easier to type
|
||||||
set magic
|
set magic
|
||||||
set hidden
|
set hidden
|
||||||
|
|
||||||
"always display status line
|
"always display status line
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
|
|
||||||
"keycodes time out fast, mappings have a bit longer
|
"keycodes time out fast, mappings have a bit longer
|
||||||
set timeout timeoutlen=1000 ttimeout ttimeoutlen=10
|
set timeout timeoutlen=1000 ttimeout ttimeoutlen=10
|
||||||
|
|
||||||
"make it so the session feature wont overwrite our vimrc if the vimrc has newer bindings than this session.
|
"make it so the session feature wont overwrite our vimrc if the vimrc has newer bindings than this session.
|
||||||
set sessionoptions-=options
|
set sessionoptions-=options
|
||||||
|
|
||||||
"tab stuff
|
"tab stuff
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
set shiftwidth=4
|
set shiftwidth=4
|
||||||
set expandtab
|
set autoindent
|
||||||
set autoindent
|
|
||||||
|
|
||||||
"if vim sees 4 whitespaces in a row, backspace will delete all of them at once, as if they were real tabs
|
|
||||||
set smarttab
|
|
||||||
|
|
||||||
"highlighting/colour stuff
|
"highlighting/colour stuff
|
||||||
"sets the colorscheme. to get a list of the available colors, do :colorscheme <Space> <C-d>
|
"sets the colorscheme. to get a list of the available colors, do :colorscheme <Space> <C-d>
|
||||||
colorscheme ron
|
colorscheme ron
|
||||||
|
|
||||||
syntax enable
|
syntax enable
|
||||||
|
|
||||||
|
|
||||||
"highlight search results
|
"highlight search results
|
||||||
set hlsearch
|
set hlsearch
|
||||||
|
|
||||||
"search as you type
|
"search as you type
|
||||||
set incsearch
|
set incsearch
|
||||||
|
|
||||||
"<leader> L clears the search highlighting
|
"<leader> L clears the search highlighting
|
||||||
noremap <leader>l :nohls<Enter>
|
noremap <leader>l :nohls<Enter>
|
||||||
|
|
||||||
"folding stuff TODO: implement other folding methods.
|
"folding stuff TODO: implement other folding methods.
|
||||||
"give a bit of margin space for fold number
|
"give a bit of margin space for fold number
|
||||||
set foldcolumn=3
|
set foldcolumn=3
|
||||||
|
|
||||||
set foldenable
|
set foldenable
|
||||||
|
|
||||||
"set the minimum number of screen lines for a fold to be closable.
|
"set the minimum number of screen lines for a fold to be closable.
|
||||||
set foldminlines=3
|
set foldminlines=3
|
||||||
|
|
||||||
"spacebar opens or closes a fold in normal mode
|
"spacebar opens or closes a fold in normal mode
|
||||||
nmap <Space> za
|
nmap <Space> za
|
||||||
|
|
||||||
"insert folding: really basic fold method. eventually I may make some custom folds, but with the foldtext fixed a bit, this shouldn't annoy me too much.
|
"insert folding: really basic fold method. eventually I may make some custom folds, but with the foldtext fixed a bit, this shouldn't annoy me too much.
|
||||||
if foldtype ==# "basicindent"
|
if foldtype ==# "basicindent"
|
||||||
"make vim fold automatically based on indentation.
|
"make vim fold automatically based on indentation.
|
||||||
set foldmethod=indent
|
set foldmethod=indent
|
||||||
"set the fold text for this method, in most cases, the line just above our fold is what we want, so we wont put any text into it. just level and linecount.
|
"set the fold text for this method, in most cases, the line just above our fold is what we want, so we wont put any text into it. just level and linecount.
|
||||||
function! Minimal_foldtext()
|
function! Minimal_foldtext()
|
||||||
let lines_count = v:foldend - v:foldstart + 1
|
let lines_count = v:foldend - v:foldstart + 1
|
||||||
let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |'
|
let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |'
|
||||||
let line_level_text = '| '.printf("%5s", 'level '.v:foldlevel).' |'
|
let line_level_text = '| '.printf("%5s", 'level '.v:foldlevel).' |'
|
||||||
let foldchar = matchstr(&fillchars, 'fold:\zs.')
|
let foldchar = matchstr(&fillchars, 'fold:\zs.')
|
||||||
let foldtextstart = lines_count_text
|
let foldtextstart = lines_count_text
|
||||||
let foldtextend = line_level_text . repeat(foldchar, 8)
|
let foldtextend = line_level_text . repeat(foldchar, 8)
|
||||||
let foldtextlength = strlen(foldtextstart . foldtextend) + &foldcolumn
|
let foldtextlength = strlen(foldtextstart . foldtextend) + &foldcolumn
|
||||||
return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend
|
return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend
|
||||||
endfunction
|
endfunction
|
||||||
set foldtext=Minimal_foldtext()
|
set foldtext=Minimal_foldtext()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"useful keybinds
|
"useful keybinds
|
||||||
"spell checking
|
"spell checking
|
||||||
"toggle spell checking
|
"toggle spell checking
|
||||||
map <leader>ss :setlocal spell!<Enter>
|
map <leader>ss :setlocal spell!<Enter>
|
||||||
|
|
||||||
"splitting pannes with <leader>| or -
|
"splitting pannes with <leader>| or -
|
||||||
nmap <leader>\| :vs<Enter>
|
nmap <leader>\| :vs<Enter>
|
||||||
nmap <leader>\- :sp<Enter>
|
nmap <leader>\- :sp<Enter>
|
||||||
|
|
||||||
" shortcuts using leader
|
" shortcuts using leader
|
||||||
" noremap <leader>sn ]s
|
" noremap <leader>sn ]s
|
||||||
" noremap <leader>sp [s
|
" noremap <leader>sp [s
|
||||||
" noremap <leader>s? z=
|
" noremap <leader>s? z=
|
||||||
|
|
||||||
"navigating splits: Control+hjkl will move from split to split
|
"navigating splits: Control+hjkl will move from split to split
|
||||||
nmap <C-h> <C-w>h
|
nmap <C-h> <C-w>h
|
||||||
nmap <C-j> <C-w>j
|
nmap <C-j> <C-w>j
|
||||||
nmap <C-k> <C-w>k
|
nmap <C-k> <C-w>k
|
||||||
nmap <C-l> <C-w>l
|
nmap <C-l> <C-w>l
|
||||||
|
|
||||||
"command mode keybinds
|
"command mode keybinds
|
||||||
"w!! writes using sudo
|
"w!! writes using sudo
|
||||||
"cnoremap w!! w !sudo tee % >/dev/null
|
"cnoremap w!! w !sudo tee % >/dev/null
|
||||||
|
|
Loading…
Reference in a new issue