commit 34fd2523a226e3f02585a8a23409f3def701b9c8 Author: Gabe Venberg Date: Tue Jan 23 00:55:43 2018 -0600 added my vimrc and readme, along with the standard .gitignore. thats pretty mutch it, really. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5100502 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.swp +*.vim +*.directory diff --git a/README.nolink b/README.nolink new file mode 100644 index 0000000..43e13a7 --- /dev/null +++ b/README.nolink @@ -0,0 +1 @@ +all of my dotfiles and text only plugins. (the few I have at the moment...) append something with .nolink to avoid it being symlinked into your home directory with a period appended before it. (this is for when and if I get around to writing a script to do that for me...) diff --git a/vim/vimrc b/vim/vimrc new file mode 100644 index 0000000..a34a19e --- /dev/null +++ b/vim/vimrc @@ -0,0 +1,145 @@ +"inital, more techinal settings + +"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 cursour + "set relativenumber + + "displays the cooridnates 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=10 + set sidescrolloff=10 + + "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 puting the cursor just after the last characher fo 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=1000 ttimeout ttimeoutlen=10 + + "make it so the session feature wont overwrite our vimrc if the vimrc has newer bindings than this a session. + set sessionoptions-=options + +"tab stuff + set tabstop=4 + set shiftwidth=4 + set expandtab + 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 + "sets the colorscheme. to get a list of the avalible colors, do :colorscheme + colorscheme ron + + syntax enable + + "highlights trailing spaces + highlight extra_white_space ctermbg=red guibg=red + match extra_white_space /\s+$/ + + "highlight search results + set hlsearch + + "search as you type + set incsearch + + " L clears the search highlighting + noremap l :nohls + +"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 + + "insert folding: really baisic fold method. eventually I may make some custom folds, but with the foldtext fixed a bit, this shouldnt annoy me too mutch. + if foldtype ==# "basicindent" + "make vim fold automatically based on indentation. + 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. + function! Minimal_foldtext() + let lines_count = v:foldend - v:foldstart + 1 + let lines_count_text = '| ' . printf("%10s", lines_count . ' lines') . ' |' + let line_level_text = '| '.printf("%5s", 'level '.v:foldlevel).' |' + let foldchar = matchstr(&fillchars, 'fold:\zs.') + let foldtextstart = lines_count_text + let foldtextend = line_level_text . repeat(foldchar, 8) + let foldtextlength = strlen(foldtextstart . foldtextend) + &foldcolumn + return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend + endfunction + set foldtext=Minimal_foldtext() + endif + +"usefull keybinds + "spell checking + "toggle spell checking + map ss :setlocal spell! + + " "shortucts using leader + " noremap sn ]s + " noremap sp [s + " noremap s? z= + + "normal mode keybinds + "control o: insert line below + nmap o + + "alt=a: select all + nmap :keepjumps normal ggVG + + "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