|
0
|
1 " Leader Mappings
|
|
|
2 map <Space> <leader>
|
|
|
3 map <Leader>w :update<CR>
|
|
|
4 map <Leader>q :qall<CR>
|
|
|
5 map <Leader>g :term gpt<CR>
|
|
|
6 set mouse=a
|
|
|
7 inoremap <C-a> <C-x><C-i>
|
|
|
8
|
|
|
9 " Support for tags closing and classes
|
|
|
10 source $HOME/.vim/plugins/taghelp
|
|
|
11 source /home/luka/.vim/plugins/dbtables.vim
|
|
|
12
|
|
|
13
|
|
|
14 syntax on
|
|
|
15 syntax enable
|
|
|
16 " File types
|
|
|
17 autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif
|
|
|
18 highlight Comment cterm=italic gui=italic
|
|
|
19 autocmd FileType *.blade.php setlocal commentstring=#\ %s
|
|
|
20
|
|
|
21 set nowrap " Dont wrap
|
|
|
22 set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163
|
|
|
23 set laststatus=2 " Show status line on startup
|
|
|
24 set splitright " Open new splits to the right
|
|
|
25 set splitbelow " Open new splits to the bottom
|
|
|
26 set lazyredraw " Reduce the redraw frequency
|
|
|
27 set ttyfast " Send more characters in fast terminals
|
|
|
28 set nobackup nowritebackup noswapfile " Turn off backup files
|
|
|
29 set noerrorbells novisualbell " Turn off visual and audible bells
|
|
|
30 "set shiftwidth=2 tabstop=2 " Two spaces for tabs everywhere
|
|
|
31 set history=500
|
|
|
32 set hlsearch " Highlight search results
|
|
|
33 set ignorecase smartcase " Search queries intelligently set case
|
|
|
34 set incsearch " Show search results as you type
|
|
|
35 set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape
|
|
|
36 set showcmd " Show size of visual selection
|
|
|
37 set smartindent " Automatic formating/indenting
|
|
|
38
|
|
|
39 " Persistent undo
|
|
|
40 set undodir=~/.vim/undo/
|
|
|
41 set undofile
|
|
|
42 set undolevels=1000
|
|
|
43 set undoreload=10000
|
|
|
44
|
|
|
45 " Tags
|
|
|
46 set tags=./tags,tags;$HOME
|
|
|
47
|
|
|
48
|
|
|
49 "-------------------------------------------------------------------------------
|
|
|
50 " Interface
|
|
|
51 "-------------------------------------------------------------------------------
|
|
|
52
|
|
|
53 set number " Enable line numbers
|
|
|
54 set relativenumber " Enable relative line numbers
|
|
|
55 set scrolloff=5 " Leave 5 lines of buffer when scrolling
|
|
|
56 set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling
|
|
|
57
|
|
|
58
|
|
|
59 nnoremap <C-Left> :tabprevious<CR>
|
|
|
60 nnoremap <C-Right> :tabnext<CR>
|
|
|
61
|
|
|
62
|
|
|
63
|
|
|
64 "-------------------------------------------------------------------------------
|
|
|
65 " Plugins
|
|
|
66 "-------------------------------------------------------------------------------
|
|
|
67 " Ensure that plug-vim is set up
|
|
|
68 let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
|
|
69 if empty(glob(data_dir . '/autoload/plug.vim'))
|
|
|
70 silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
|
71 autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
|
|
|
72 endif
|
|
|
73
|
|
|
74 call plug#begin()
|
|
|
75 " Environment Plugins
|
|
|
76 "
|
|
|
77 " NERDTree
|
|
|
78 source $HOME/.vim/plugins/nerdtree
|
|
|
79
|
|
|
80 " Coding and language specifics
|
|
|
81 "
|
|
|
82 " LSP - ale
|
|
|
83 source $HOME/.vim/plugins/ale
|
|
|
84
|
|
|
85 " Blade
|
|
|
86 Plug 'jwalton512/vim-blade', { 'for': 'php' }
|
|
|
87 " Use release branch (recommended)
|
|
|
88 source $HOME/.vim/plugins/coc
|
|
|
89
|
|
|
90 " AI-ify
|
|
|
91 Plug 'madox2/vim-ai'
|
|
|
92
|
|
|
93 call plug#end()
|
|
|
94
|
|
|
95 " CTRLP
|
|
|
96 source $HOME/.vim/plugins/ctrlp
|
|
|
97
|
|
|
98 " Netwr
|
|
|
99 set nocp
|
|
|
100 filetype plugin on " plugins are enabled
|
|
|
101
|
|
|
102
|
|
|
103 " Use project based .vimrc's
|
|
|
104 set exrc
|
|
|
105
|
|
|
106
|
|
|
107 " Get some better php support for ale see https://github.com/dense-analysis/ale/blob/master/supported-tools.md
|