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