2018-09-05 07:57:17 +02:00
"Customized vim/neovim config
2021-07-12 19:00:24 +02:00
"Copyright 2018 Gabe Venberg
2018-09-05 07:57:17 +02:00
"This program is free software: you can redistribute it and/or modify
"it under the terms of the GNU General Public License as published by
"the Free Software Foundation, either version 3 of the License, or
"(at your option) any later version.
"
"This program is distributed in the hope that it will be useful,
"but WITHOUT ANY WARRANTY; without even the implied warranty of
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
"GNU General Public License for more details.
2018-08-09 21:55:33 +02:00
"
2018-09-05 07:57:17 +02:00
"You should have received a copy of the GNU General Public License
"along with this program. If not, see <http://www.gnu.org/licenses/>.
2018-08-09 21:55:33 +02:00
"this sets what sort of folding method to use.
2021-09-07 06:07:40 +02:00
let foldtype = "indent"
2018-08-09 21:55:33 +02:00
set lazyredraw
set autoread
set history = 5000
filetype plugin on
2018-12-21 21:24:39 +01:00
set noswapfile "disables creation of swap files
2018-08-09 21:55:33 +02:00
2021-01-06 20:30:47 +01:00
"useful keybinds
2024-02-22 23:10:47 +01:00
let mapleader = "\\"
"spell checking
"toggle spell checking
noremap < leader > ss :setlocal spell ! < CR >
"splitting panels with <leader>| or -
nnoremap < leader > \| :vs < Enter >
nnoremap < leader > \- :sp < Enter >
" shortcuts using leader
" noremap <leader>sn ]s
" noremap <leader>sp [s
" noremap <leader>s? z=
"navigating splits: Control+hjkl will move from split to split
nnoremap < C - h > < C - w > h
nnoremap < C - j > < C - w > j
nnoremap < C - k > < C - w > k
nnoremap < C - l > < C - w > l
"command mode keybinds
"w!! writes using sudo
"cnoremap w!! w !sudo tee % >/dev/null
2021-01-06 20:30:47 +01:00
2018-08-09 21:55:33 +02:00
"user interface stuff
2024-02-22 23:10:47 +01:00
"disables the autocommenting stuff.
set formatoptions - = o
set formatoptions - = r
set formatoptions - = c
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"disable text wrapping via carriage returns, should only wrap visually
set textwidth = 0
set wrapmargin = 0
set wrap
set linebreak
set breakindent
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"adds a ruler to the side of the screen
set number
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"displays the coordinates of your cursour in the statusbar
set ruler
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"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 = 5
set sidescrolloff = 5
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"better command line completion
set wildmenu
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"ignore cases in search unless you have a capital letter in the search
set ignorecase
set smartcase
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"this allows putting the cursor just after the last character of the line.
"set virtualedit=onemore
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"show unfinished commands on the RIGHT side of the statusbar. yes, it is working.
set showcmd
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"make regex a bit easier to type
set magic
set hidden
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"always display status line
set laststatus = 2
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"keycodes time out fast, mappings have a bit longer
set timeout timeoutlen = 1000 ttimeout ttimeoutlen = 100
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"make it so the session feature wont overwrite our vimrc if the vimrc has newer bindings than this session.
set sessionoptions - = options
2018-08-09 21:55:33 +02:00
"tab stuff
2024-02-22 23:10:47 +01:00
set tabstop = 4
set shiftwidth = 4
set autoindent
2018-08-09 21:55:33 +02:00
"highlighting/colour stuff
2024-02-22 23:10:47 +01:00
"sets the colorscheme. to get a list of the available colors, do :colorscheme <Space> <C-d>
colorscheme ron
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
syntax enable
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"highlight search results
set hlsearch
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"search as you type
set incsearch
2018-08-09 21:55:33 +02:00
2024-02-22 23:10:47 +01:00
"<leader> L clears the search highlighting
noremap < leader > l :nohls < CR >