From af819f8ad67ebdfd48b41b1a0db568d55df5c571 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Thu, 9 Aug 2018 14:55:33 -0500 Subject: [PATCH] for some reason, my gitignore excluded .vim files, sutch as my nvim config. --- .gitignore | 1 - neovim/.config/nvim/init.vim | 132 +++++++++++++++++++++++++++++++++++ 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 neovim/.config/nvim/init.vim diff --git a/.gitignore b/.gitignore index 5100502..91171fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ *.swp -*.vim *.directory diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim new file mode 100644 index 0000000..e1a4776 --- /dev/null +++ b/neovim/.config/nvim/init.vim @@ -0,0 +1,132 @@ +" + +"this sets what sort of folding method to use. +let foldtype="basicindent" +set lazyredraw +set autoread +set history=5000 +filetype plugin on + +"user interface stuff + "disables the autocommenting stuff. + set formatoptions-=o + set formatoptions-=r + set formatoptions-=c + + "disable text wrapping via carriage returns, should only wrap visually + set textwidth=0 + set wrapmargin=0 + set wrap + set linebreak + set breakindent + + "adds a ruler to the side of the screen + set number + + "makes the ruler show how many lines away a given line is from your cursor + "set relativenumber + + "displays the coordinates of your cursour in the statusbar + 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 + set scrolloff=5 + set sidescrolloff=5 + + "better command line completion + set wildmenu + + "ignore cases in search unless you have a capital letter in the search + set ignorecase + set smartcase + + "this allows putting the cursor just after the last character of the line. + "set virtualedit=onemore + + "show unfinished commands on the RIGHT side of the statusbar. yes, it is working. + set showcmd + + "make regex a bit easier to type + set magic + set hidden + + "always display status line + set laststatus=2 + + "keycodes time out fast, mappings have a bit longer + set timeout timeoutlen=50 ttimeout ttimeoutlen=5 + + "make it so the session feature wont overwrite our vimrc if the vimrc has newer bindings than this session. + set sessionoptions-=options + +"tab stuff + set tabstop=4 + set shiftwidth=4 + set autoindent + +"highlighting/colour stuff + "sets the colorscheme. to get a list of the available colors, do :colorscheme + colorscheme ron + + syntax enable + + + "highlight search results + set hlsearch + + "search as you type + set incsearch + + " L clears the search highlighting + noremap l :nohls + +"neovim stuff + if has('nvim') + set guicursor= + endif + +"folding stuff TODO: implement other folding methods. + "give a bit of margin space for fold number + set foldcolumn=3 + + set foldenable + + "set the minimum number of screen lines for a fold to be closable. + set foldminlines=3 + + "spacebar opens or closes a fold in normal mode + nmap za + + "indent 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" + "make vim fold automatically based on indentation. + set foldmethod=indent + "make sure that comment are counted in indent folding! + set foldignore= + "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. TODO + "set foldtext=Minimal_foldtext() + endif + +"useful keybinds + "spell checking + "toggle spell checking + map ss :setlocal spell! + + "splitting panels with | or - + nmap \| :vs + nmap \- :sp + + " shortcuts using leader + " noremap sn ]s + " noremap sp [s + " noremap s? z= + + "navigating splits: Control+hjkl will move from split to split + nmap h + nmap j + nmap k + nmap l + + "command mode keybinds + "w!! writes using sudo + "cnoremap w!! w !sudo tee % >/dev/null