From 8963766fac56dbc8eaae3effb4803ceff3b85a03 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Fri, 29 May 2020 11:13:58 +0100 Subject: [PATCH] Makes leader space along with other small changes Adds commets Adds leader+s to search/replace current word --- vimrc | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/vimrc b/vimrc index a83940e..c79af7b 100644 --- a/vimrc +++ b/vimrc @@ -14,12 +14,13 @@ call pathogen#helptags() "Leaders {{{1 -let mapleader = "," +let mapleader = "\" let maplocalleader = "\\" +" Access colors present in 256 colorspace +let base16colorspace=256 -let base16colorspace=256 " Access colors present in 256 colorspace - +" Set my colourscheme colorscheme base16-gruvbox-dark-hard " Config {{{1 @@ -54,6 +55,9 @@ set path+=** set wildmenu set wildignore+=*.min.js,*.min.css,*/node_modules/*,*/dist/* +" Allows vim to background buffers without saving +set hidden + " Time vim waits to see if you are pushing another key set timeoutlen=500 @@ -78,6 +82,7 @@ set backspace=indent,eol,start " Show commands as you type them set showcmd +" Highlighting the current line set cursorline " Make vim default to the plus register (system clipboard) when yanking etc. @@ -102,6 +107,7 @@ au! autocmd VimEnter * silent !echo -ne "\e[1 q" augroup END +" Makes vim try to keep 5 lines visible at the top and bottom set scrolloff=5 @@ -153,11 +159,8 @@ let g:fzf_command_prefix = 'Fzf' nnoremap f = :FzfFiles nnoremap b = :FzfBuffers nnoremap h = :FzfHelptags -nnoremap / = :FzfRg - -" typescript -let g:typescript_indent_disable = 1 - +" Space is important at the end of this command +nnoremap / = :FzfRg " deoplete @@ -183,6 +186,12 @@ function! NewLatex() setlocal filetype=tex endfunction +function! NewShellscript() + read ~/Templates/boilerplate.sh + normal! ggdd + setlocal filetype=bash +endfunction + " Moves to open window, or focuses it " https://www.reddit.com/r/vim/comments/8f80o3/awesome_way_to_navigate_windows_and_autocreate/ function! WinMove(key) @@ -227,7 +236,7 @@ nnoremap cC :w! \| !compiler % nnoremap cl :w! \| !compiler % letter nnoremap cL :w! \| !compiler % letter -" Opens the compiled documetn +" Opens the compiled documents " If something like html, it doesn't need to be compiled first nnoremap co :!opout % @@ -255,11 +264,16 @@ inoremap "+pa " map gV to select previously pasted nnoremap gV "`[".getregtype(v:register)[0]."`]" -" + +" Makes :w1 work the same as :w! (saves pushing the shift key) cnoremap w1 w! +" Same for quitting +cnoremap q1 q! +cnoremap qa1 qa! " Set :w!! to save with sudo cnoremap w!! w !sudo tee % +" The same but without shift cnoremap w11 w !sudo tee % "Run current line as command @@ -268,10 +282,12 @@ vnoremap q !$SHELL " Do Shebang line " inoremap :sil exe ".!which " s/^/#!/ filetype detectYpDi -inoremap :sil s/^/#!\/usr\/bin\/env / filetype detectYpDi +inoremap :sil s/^/#!\/usr\/bin\/env / filetype detect:nohlYpDi +" Makes leader+s replace on the current wordd +nnoremap s :%s/=expand('')//g -" DO bullet points +" Do bullet points inoremap :exe "norm Ypf lDB\"A " edit vimrc @@ -280,12 +296,12 @@ nnoremap sv :source $MYVIMRC " add new line without entering insert mode nnoremap o -nnoremap O +nnoremap O " Make jj in insert mode go to normal mode inoremap jj -" Fix previous spelling mistake +" Fix previous spelling mistake in insert mode inoremap u[s1z=`]au @@ -314,9 +330,11 @@ noremap! [I noremap! [O +" Url encode and decode current selection vnoremap u :B !urlencode vnoremap U :B !urldecode + " File Type Specific {{{1 "Make web files fold on indent {{{2 augroup file_web