summaryrefslogtreecommitdiff
path: root/init.vim
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-02-15 08:52:32 +0000
committerAkshay <[email protected]>2021-02-15 08:52:32 +0000
commitfcaf13a267b7bacd26ad8b2e952a793645e42bba (patch)
tree6e795b46b1fbefb05151e95c0346951d67fac4e7 /init.vim
init
Diffstat (limited to 'init.vim')
-rw-r--r--init.vim224
1 files changed, 224 insertions, 0 deletions
diff --git a/init.vim b/init.vim
new file mode 100644
index 0000000..8eb7889
--- /dev/null
+++ b/init.vim
@@ -0,0 +1,224 @@
1let &t_ZM = "\e[3m"
2
3call plug#begin('~/.local/share/nvim/plugged')
4
5Plug 'airblade/vim-gitgutter'
6Plug 'godlygeek/tabular'
7Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
8Plug 'junegunn/fzf.vim'
9Plug 'vimwiki/vimwiki'
10
11" tpope
12Plug 'tpope/vim-repeat'
13Plug 'tpope/vim-surround'
14Plug 'tpope/vim-unimpaired'
15Plug 'tpope/vim-fugitive'
16
17" syntax and friends
18Plug 'rust-lang/rust.vim', {'for': 'rust'}
19Plug 'lervag/vimtex', {'for': 'tex'}
20Plug 'neovimhaskell/haskell-vim', {'for': ['haskell', 'cabal']}
21Plug 'elmcast/elm-vim'
22Plug 'LnL7/vim-nix'
23
24" my stuff
25Plug 'git@ferrn:vim/vim-colors-plain'
26Plug 'git@ferrn:vim/better-text-objs'
27
28" nvim only
29Plug 'hrsh7th/nvim-compe'
30Plug 'neovim/nvim-lspconfig'
31Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
32
33call plug#end()
34
35
36" augroups
37
38augroup plaintext
39 autocmd!
40 autocmd FileType text,markdown setlocal ts=2 sts=2 sw=2 expandtab textwidth=60
41augroup END
42
43augroup webdev
44 autocmd!
45 autocmd FileType less,css,html,js?,ts? setlocal ts=2 sts=2 sw=2 expandtab
46 autocmd FileType less,css,html nnoremap <Leader>s viB:sort<cr>
47augroup END
48
49augroup restorecursor
50 autocmd BufReadPost *
51 \ if line("'\"") > 1 && line("'\"") <= line("$") |
52 \ execute "normal! g`\"" |
53 \ endif
54augroup END
55
56augroup vimrc-incsearch-highlight
57 autocmd!
58 autocmd CmdlineEnter /,\? :set hlsearch
59 autocmd CmdlineLeave /,\? :set nohlsearch
60augroup END
61
62augroup fzfstatus
63 if has('nvim') && !exists('g:fzf_layout')
64 autocmd! FileType fzf
65 autocmd FileType fzf set laststatus=0 noshowmode noruler
66 \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
67 endif
68augroup END
69
70" general settings
71set nobackup
72set nowritebackup
73set noswapfile " get rid of swapfiles everywhere
74set dir=/tmp
75
76syntax on
77
78set omnifunc=syntaxcomplete#Complete
79set completefunc=LanguageClient#complete
80set list
81filetype off
82filetype plugin indent on
83set laststatus=2
84set nowrap
85set noshowmode
86set listchars=tab:┊\ ,nbsp:␣,trail:·,extends:>,precedes:<
87set fillchars=vert:\│,stl:\ ,stlnc:\
88set ignorecase
89set smartcase
90set sidescroll=40
91set incsearch
92set undofile
93set undodir=~/tmp
94set path+=**
95set backspace=indent,eol,start
96set hidden
97set wildmenu
98set complete=.,w,b,i,u,t,
99set background=dark
100set mouse=a
101set conceallevel=0
102set nonumber
103set grepprg=rg\ --vimgrep\ --no-heading
104set grepformat=%f:%l:%c:%m,%f:%l:%m
105set cmdheight=2
106set shortmess+=c
107set updatetime=300
108set signcolumn=yes
109set inccommand=split
110set showmatch
111set diffopt+=vertical
112set completeopt=menuone,noinsert,noselect
113
114let g:netrw_browsex_viewer= "xdg-open"
115
116colorscheme plain
117
118set shiftwidth=4 " indent = 4 spaces
119set expandtab
120set tabstop=4 " tab = 4 spaces
121set softtabstop=4 " backspace through spaces
122
123" Functions
124function! GetTabber() " a lil function that integrates well with Tabular.vim
125 let c = nr2char(getchar())
126 :execute 'Tabularize /' . c
127endfunction
128
129" Ugh
130command! WQ wq
131command! Wq wq
132command! Wqa wqa
133command! WQa wqa
134command! W w
135command! Q q
136
137" abbreviations
138abclear
139iab #i #include
140iab #d #define
141cab dst put =strftime('%d %a, %b %Y')<cr>
142cab vg vimgrep
143cab vga vimgrepadd
144cab bfd bufdo
145
146" man pages
147let g:ft_man_open_mode = 'tab'
148
149let g:gitgutter_override_sign_column_highlight = 0
150let g:gitgutter_sign_added = '+'
151let g:gitgutter_sign_modified = '~'
152let g:gitgutter_sign_removed = '-'
153let g:gitgutter_sign_removed_first_line = '-'
154let g:gitgutter_sign_modified_removed = '~'
155
156let g:fzf_colors =
157 \ { 'fg': ['fg', 'Noise'],
158 \ 'bg': ['bg', 'Noise'],
159 \ 'hl': ['fg', 'Statement'],
160 \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
161 \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
162 \ 'hl+': ['fg', 'Statement'],
163 \ 'info': ['fg', 'PreProc'],
164 \ 'border': ['fg', 'Ignore'],
165 \ 'prompt': ['fg', 'Conditional'],
166 \ 'pointer': ['fg', 'Exception'],
167 \ 'marker': ['fg', 'Keyword'],
168 \ 'spinner': ['fg', 'Label'],
169 \ 'header': ['fg', 'Comment'] }
170let g:fzf_layout = { 'down': '40%' }
171let g:fzf_preview_window = []
172
173highlight GitGutterAdd ctermfg=8
174highlight GitGutterChange ctermfg=8
175highlight GitGutterDelete ctermfg=8
176
177let g:rustfmt_autosave = 1
178
179let g:latex_view_general_viewer = "zathura"
180let g:vimtex_view_method = "zathura"
181let g:tex_flavor = 'latex'
182
183let g:elm_setup_keybindings = 0
184
185let g:completion_enable_auto_hover = 0
186let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy', 'all']
187let g:completion_trigger_on_delete = 1
188
189let g:compe = {}
190let g:compe.enabled = v:true
191let g:compe.autocomplete = v:true
192let g:compe.debug = v:false
193let g:compe.min_length = 1
194let g:compe.preselect = 'enable'
195let g:compe.throttle_time = 80
196let g:compe.source_timeout = 200
197let g:compe.incomplete_delay = 400
198let g:compe.max_abbr_width = 100
199let g:compe.max_kind_width = 100
200let g:compe.max_menu_width = 100
201let g:compe.documentation = v:true
202
203let g:compe.source = {}
204let g:compe.source.path = v:true
205let g:compe.source.buffer = v:true
206let g:compe.source.calc = v:true
207let g:compe.source.vsnip = v:false
208let g:compe.source.nvim_lsp = v:true
209let g:compe.source.nvim_lua = v:false
210let g:compe.source.spell = v:true
211let g:compe.source.tags = v:true
212let g:compe.source.snippets_nvim = v:false
213let g:compe.source.treesitter = v:true
214let g:compe.source.omni = v:true
215
216sign define LspDiagnosticsSignError text=× texthl=LspDiagnosticsSignError linehl= numhl=
217sign define LspDiagnosticsSignWarning text=\! texthl=LspDiagnosticsSignWarning linehl= numhl=
218sign define LspDiagnosticsSignInformation text=i texthl=LspDiagnosticsSignInformation linehl= numhl=
219sign define LspDiagnosticsSignHint text=\~ texthl=LspDiagnosticsSignHint linehl= numhl=
220
221lua << EOF
222require 'lsp'
223require 'treesitter'
224EOF