|
| 1 | +if !has('nvim') |
| 2 | + set ttymouse=xterm2 |
| 3 | +endif |
| 4 | + |
| 5 | +" This is the main vim configuration file. |
| 6 | +" It is executed as a series of commands when vim starts up |
| 7 | + |
| 8 | +" Enables Syntax highlighting |
| 9 | +syntax on |
| 10 | + |
| 11 | +" Filetype plugin on |
| 12 | +filetype plugin indent on |
| 13 | + |
| 14 | +"Enables Mouse Usage |
| 15 | +set mouse=a |
| 16 | + |
| 17 | +" Enables line numbers (relative) |
| 18 | +set relativenumber |
| 19 | + |
| 20 | +" Expands tabs to spaces with the tab key |
| 21 | +set expandtab |
| 22 | +set smarttab |
| 23 | +set shiftwidth=2 |
| 24 | +set tabstop=2 |
| 25 | +set autoindent |
| 26 | +"set smartindent |
| 27 | + |
| 28 | + |
| 29 | +" Remember Cursor position |
| 30 | +au BufReadPost * |
| 31 | + \ if line("'\"") > 0 && line("'\"") <= line("$") && &filetype != "gitcommit" | |
| 32 | + \ execute("normal `\"") | |
| 33 | + \ endif |
| 34 | + |
| 35 | +" Sets vim to use OS clipboard |
| 36 | +set clipboard^=unnamed |
| 37 | + |
| 38 | +" Prevents formatting bullshit when pasting |
| 39 | +set nopaste |
| 40 | + |
| 41 | +" Enables alt-mappings to function properly |
| 42 | +for i in range(97,122) |
| 43 | + let c = nr2char(i) |
| 44 | + exec "map \e".c." <M-".c.">" |
| 45 | + exec "map! \e".c." <M-".c.">" |
| 46 | +endfor |
| 47 | + |
| 48 | + |
| 49 | +" Enables lines and blocks swapping with alt-j, altk |
| 50 | +nnoremap <M-j> :m .+1<CR>== |
| 51 | +nnoremap <M-k> :m .-2<CR>== |
| 52 | +nnoremap <M-J> :m .+10<CR>== |
| 53 | +nnoremap <M-K> :m .-11<CR>== |
| 54 | +inoremap <M-j> <Esc>:m .+1<CR>==gi |
| 55 | +inoremap <M-k> <Esc>:m .-2<CR>==gi |
| 56 | +vnoremap <M-j> :m '>+1<CR>gv=gv |
| 57 | +vnoremap <M-k> :m '<-2<CR>gv=gv |
| 58 | +" Reduces delay for escape as alt has the same sequence as escape |
| 59 | +set timeoutlen=10 ttimeoutlen=0 |
| 60 | + |
| 61 | +" Faster line movement with uppercase J and K |
| 62 | +map <S-j> 10j |
| 63 | +map <S-k> 10k |
| 64 | +
|
| 65 | +" Through Paragraphs with { down and } up as opposed to default (reversed) |
| 66 | +nnoremap { } |
| 67 | +nnoremap } { |
| 68 | +
|
| 69 | +" Editing a protected file as 'sudo' |
| 70 | +cmap w!! %!sudo tee > /dev/null % |
| 71 | +
|
| 72 | +set t_Co=256 |
| 73 | +highlight ColorColumn ctermbg=0 |
| 74 | +set colorcolumn=80 |
| 75 | +" It is possible to configure settings with this file. |
| 76 | +" This line sets it so that |
| 77 | +" automatically |
| 78 | +" when the buffer is read into (when a file is loaded) |
| 79 | +" when the filename matches any asm file |
| 80 | +" execute the command after the colon - this sets filetype to be nasm for highlighting |
| 81 | +au BufRead *.asm :set ft=nasm |
| 82 | + |
| 83 | +"colorscheme solarized8_dark |
| 84 | +"set background=dark |
| 85 | +"highlight Normal ctermbg=Black |
| 86 | + |
| 87 | +"---------- Hardcore nav mode, not reccomended for newbs |
| 88 | + |
| 89 | +" Disable Arrow keys in Escape mode |
| 90 | +" map <up> <nop> |
| 91 | +" map <down> <nop> |
| 92 | +" map <left> <nop> |
| 93 | +" map <right> <nop> |
| 94 | + |
| 95 | +" Disable Arrow keys in Insert mode |
| 96 | +" imap <up> <nop> |
| 97 | +" imap <down> <nop> |
| 98 | +" imap <left> <nop> |
| 99 | +" imap <right> <nop> |
| 100 | + |
| 101 | +"----------PLUGINS---------------------------------- |
| 102 | + |
| 103 | +" Specify a directory for plugins |
| 104 | +" - For Neovim: ~/.local/share/nvim/plugged |
| 105 | +" - Avoid using standard Vim directory names like 'plugin' |
| 106 | +call plug#begin('~/.vim/plugged') |
| 107 | + |
| 108 | +Plug 'kien/ctrlp.vim' |
| 109 | +Plug 'scrooloose/syntastic' |
| 110 | +Plug 'ervandew/supertab' |
| 111 | +Plug 'bling/vim-airline' |
| 112 | +Plug 'vim-airline/vim-airline-themes' |
| 113 | +Plug 'yggdroot/indentline' |
| 114 | +Plug 'christoomey/vim-tmux-navigator' |
| 115 | +Plug 'jiangmiao/auto-pairs' |
| 116 | + |
| 117 | +call plug#end() |
| 118 | + |
| 119 | +"-------------------CtrlP----------------------- |
| 120 | + |
| 121 | +let g:ctrlp_custom_ignore = { |
| 122 | + \ 'dir': '\v[\/]\.(git|hg|svn)$', |
| 123 | + \ 'file': '\v\.(exe|so|dll)$', |
| 124 | + \ } |
| 125 | + |
| 126 | +let g:ctrlp_show_hidden = 1 |
| 127 | + |
| 128 | + |
| 129 | +"--------------------Airline Status Bar------------- |
| 130 | +set laststatus=2 |
| 131 | +set noshowmode |
| 132 | + |
| 133 | +let g:airline_theme='monochrome' |
| 134 | + |
| 135 | +let g:airline#extensions#tabline#enabled = 1 |
| 136 | +let g:airline#extensions#tabline#left_sep = ' ' |
| 137 | +let g:airline#extensions#tabline#left_alt_sep = '|' |
| 138 | + |
| 139 | +" Show just the filename |
| 140 | +let g:airline#extensions#tabline#fnamemod = ':t' |
| 141 | + |
| 142 | +" This allows buffers to be hidden if you've modified a buffer. |
| 143 | +" This is almost a must if you wish to use buffers in this way. |
| 144 | +set hidden |
| 145 | + |
| 146 | +" To open a new empty buffer |
| 147 | +" This replaces :tabnew which I used to bind to this mapping |
| 148 | +nmap <leader>T :enew<CR> |
| 149 | +
|
| 150 | +" Move to the next buffer |
| 151 | +nnoremap <silent> ] :bnext<CR> |
| 152 | +
|
| 153 | +" Move to the previous buffer |
| 154 | +nnoremap <silent> [ :bprevious<CR> |
| 155 | +
|
| 156 | +"-------------Syntastic------------------------------ |
| 157 | + |
| 158 | +set statusline+=%#warningmsg# |
| 159 | +set statusline+=%{SyntasticStatuslineFlag()} |
| 160 | +set statusline+=%* |
| 161 | + |
| 162 | +let g:syntastic_always_populate_loc_list = 1 |
| 163 | +let g:syntastic_auto_loc_list = 1 |
| 164 | +let g:syntastic_check_on_open = 1 |
| 165 | +let g:syntastic_check_on_wq = 0 |
| 166 | + |
| 167 | + |
| 168 | +" C config |
| 169 | +let g:syntastic_c_include_dirs = [ '../include', 'include', '../../include', '../../../include', 'header', '../headers', '../../headers', '../../../headers', '../utils/include', '../../utils/include'] |
| 170 | + |
| 171 | +" Java classpaths |
| 172 | +let g:syntastic_java_checkers=['java'] |
| 173 | +let g:syntastic_java_javac_config_file_enabled = 1 |
| 174 | + |
| 175 | + |
| 176 | +"----------------Indent Guides------------- |
| 177 | + |
| 178 | +let g:indent_guides_enable_on_vim_startup = 1 |
| 179 | + |
| 180 | +"-----------------Tmux Integration----------- |
| 181 | +let g:tmux_navigator_no_mappings = 1 |
| 182 | +" |
| 183 | +"nnoremap <silent> <M-Left> :TmuxNavigateLeft<cr> |
| 184 | +"nnoremap <silent> <M-Down> :TmuxNavigateDown<cr> |
| 185 | +"nnoremap <silent> <M-Up> :TmuxNavigateUp<cr> |
| 186 | +"nnoremap <silent> <M-Right> :TmuxNavigateRight<cr> |
| 187 | +""nnoremap <silent> {Previous-Mapping} :TmuxNavigatePrevious<cr> |
0 commit comments