aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc156
1 files changed, 119 insertions, 37 deletions
diff --git a/vimrc b/vimrc
index 3d6146c..a41b562 100644
--- a/vimrc
+++ b/vimrc
@@ -1,45 +1,127 @@
-"-----------------------------------------------------------------------------------------------------------------------
" Plugins
-"----------------------------------------------------------------------------------------------------------------------
call plug#begin('~/.vim/plugged')
-
-" Extending vim functionality
-Plug 'mileszs/ack.vim' " Use ack to grep project directory
-Plug 'scrooloose/syntastic' " Syntax checking
-Plug 'terryma/vim-multiple-cursors' " Multipe cursors, like the sublime feature
-Plug 'godlygeek/tabular' " Lines up code
-Plug 'jamessan/vim-gnupg' " Loads encrypted files by asking for password
-Plug 'gcmt/taboo.vim' " Rename Tabs
-Plug 'mattn/emmet-vim' " HTML expansion plugin, very useful
-Plug 'bkad/CamelCaseMotion' " Camel Case based motions
-Plug 'tmhedberg/SimpylFold' " Folding for python
+Plug 'w0rp/ale' " Async linting
Plug 'tpope/vim-commentary' " Better commenting commands
Plug 'tpope/vim-fugitive' " Git integration with vim
Plug 'tpope/vim-surround' " Helps with surrounding text
-Plug 'tmhedberg/matchit' " Match tags in html
-Plug 'rbgrouleff/bclose.vim' " ranger.vim dep
-Plug 'francoiscabrol/ranger.vim' " ranger intergration
-Plug 'junegunn/fzf.vim' " fzf integration
-
-" Syntax highlighting / Themes
Plug 'morhetz/gruvbox' " Pretty colorscheme
-Plug 'nathanaelkane/vim-indent-guides' " Creates indent lines, makes code a bit easier to read
-Plug 'plasticboy/vim-markdown'
-Plug 'ledger/vim-ledger'
-Plug 'stephpy/vim-yaml'
-Plug 'mitsuhiko/vim-python-combined'
-Plug 'elzr/vim-json'
-Plug 'digitaltoad/vim-pug'
-Plug 'elixir-lang/vim-elixir'
-Plug 'othree/yajs.vim' " Javascript syntax
-Plug 'gavocanov/vim-js-indent'
-Plug 'mitsuhiko/vim-jinja'
-Plug 'chr4/nginx.vim'
-Plug 'reedes/vim-pencil'
-Plug 'junegunn/goyo.vim'
-
-" My custom options
-Plug 'thornycrackers/vim-options'
-
+Plug 'Valloric/YouCompleteMe' " Autocomplete
+Plug 'ledger/vim-ledger' " Ledger plugin
+Plug 'python-mode/python-mode' " Python awesomeness in vim
call plug#end()
+
+" General Settings
+set nocompatible " Disable vi-compatible
+set wildmenu " Enable autocomple menu
+set incsearch " Show search results as typing string
+set hlsearch " Highlight matches to previos search string
+set expandtab " In Insert mode: Use the appropriate number of spaces to insert <Tab>.
+set tabstop=4 "Number of spaces that a <Tab> counts for
+set shiftwidth=0 " Make shiftwidth value the same as tabstop
+set relativenumber " Use relative numbers in the side bar
+set nowrap " Turn off text wrapping long lines
+set history=1000 " Set number of ':' commands
+set wildmode=list:full " wildmenu show list complete to first result
+set splitright " New windows split to the right of current one
+set splitbelow " New windows split below the current one
+set completeopt-=preview " Hide the preview/scratch window
+
+" Custom status line
+set statusline=
+set statusline+=%1*\ %02c\ " Color
+set statusline+=%2*\ » " RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+set statusline+=%3*\ %<%F\ " File+path
+set statusline+=%2*\« " LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+set statusline+=%2*\ %=\ %l/%L\ (%02p%%)\ " Rownumber/total (%)
+
+" Set spacing of filetypes
+autocmd FileType sh,python setlocal tabstop=4
+autocmd FileType make setlocal tabstop=4 noexpandtab
+autocmd FileType ledger setlocal tabstop=2
+autocmd FileType vim setlocal tabstop=2
+
+" Setup colorscheme
+syntax enable
+colorscheme gruvbox " Set the colorscheme
+set background=dark " Use dark colorscheme
+
+" Set vimdiff colors, make it easier to read
+highlight DiffAdd cterm=BOLD ctermfg=NONE ctermbg=22
+highlight DiffDelete cterm=BOLD ctermfg=NONE ctermbg=52
+highlight DiffChange cterm=BOLD ctermfg=NONE ctermbg=23
+highlight DiffText cterm=BOLD ctermfg=NONE ctermbg=23
+
+" Highlight lines at 80 mark
+highlight ColorColumn ctermbg=cyan
+au BufNewFile,BufRead * call matchadd('ColorColumn', '\%81v', 100)
+
+" Highlight lines at 120 mark
+au BufNewFile,BufRead * call matchadd('Error', '\%121v', 100)
+
+" My Shorcuts
+let mapleader="\<Space>"
+" type jj to get out of insert mode
+inoremap jj <ESC>
+" Ctags for python project
+command! MakeTagsPython !ctags --languages=python --python-kinds=-i -R .
+" Command for figuring out highlight group
+map <leader>hi :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" . " FG:" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"fg#")<CR>
+" Turn off syntax highlighting
+nnoremap <leader><leader> :noh<CR>
+" New tab
+nnoremap <C-w>t :tabnew<CR>
+" Visually select pasted text
+nnoremap gp `[v`]
+" Vimdiff commands
+nnoremap <leader>du :diffupdate<CR>
+nnoremap <leader>dd :diffget<CR>
+nnoremap <leader>df :diffput<CR>
+nnoremap _ [c
+nnoremap = ]c
+" Visually select line without ending
+nnoremap <leader>v ^v$h
+" Some very useful shortcuts for editing Ledger entries
+" Copy the last entry
+nnoremap <leader>ll G{jV}y}p10l
+" Copy the current entry to the bottom, copy date from last entry
+nnoremap <leader>lb {jV}yGp10l{{jvEy}jvEpl
+" Copy the current entry to the next position
+nnoremap <leader>ln {jV}y}p10l
+" Jump down from line to replace dollar ammount
+nnoremap <leader>ld j^f$lC
+" After searching pull entry to current position
+nnoremap <leader>ly vapy<C-o>p{{jvEy}jvEpl
+" Accept current autocomplete suggestion
+inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
+
+
+"-----------------------------------------------------------------------------------------------------------------------
+" Ale
+"-----------------------------------------------------------------------------------------------------------------------
+let g:ale_lint_on_enter = 0
+let g:ale_sign_column_always = 1
+let g:ale_lint_on_text_changed = 'never'
+let g:ale_python_mypy_options='--ignore-missing-imports'
+let g:ale_history_enabled = 0
+highlight clear ALEErrorSign
+highlight clear ALEWarningSign
+" Change gutter color
+highlight SignColumn cterm=NONE ctermfg=0 ctermbg=None
+"-----------------------------------------------------------------------------------------------------------------------
+
+
+
+"-----------------------------------------------------------------------------------------------------------------------
+" Python Mode
+"-----------------------------------------------------------------------------------------------------------------------
+let g:pymode_run = 1
+let g:pymode_indent = 1
+let g:pymode_motion = 1
+let g:pymode_options_colorcolumn = 0
+let g:pymode_lint = 0
+let g:pymode_rope = 0
+let g:pymode_doc = 0
+let g:pymode_breakpoint = 0
+let g:pymode_lint = 0
+let g:pymode_folding = 0
"-----------------------------------------------------------------------------------------------------------------------