-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
65 lines (56 loc) · 1.97 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
" Specify a directory for plugins
let g:config_location = stdpath('config')
lua require 'user.autocmds'
lua require 'user.options'
lua require 'user.mappings'
execute "source " . g:config_location ."/"."abbreviation.vim"
function! MyFoldText()
let n = v:foldend - v:foldstart + 1
let startLine = getline(v:foldstart)
if &expandtab == 0
let unindented = substitute(startLine, '^\s\+', '', '')
let indent = repeat(' ', indent(v:foldstart))
let startLine = indent . unindented
end
let endLine = substitute(getline(v:foldend), '^[\s\t]*', '', '')
return startLine . " .." . n . ".. " . endLine
endfunction
set foldtext=MyFoldText()
let g:fugitive_browse_handlers = ['CustomGBrowseHandler']
function! CustomGBrowseHandler(args)
" Convert vim assoc array to lua table
let table = substitute(string(a:args), "'\\(\\w\\+\\)':", "\\1 =", "g")
return luaeval("require'fugitivehandlers'.CustomGBrowseHandler(" . table . ")")
endfunction
command! -nargs=1 Browse :call BrowseFunc(<q-args>)<cr>
function! BrowseFunc(opts)
let opts = substitute(a:opts, '#', '\\#', 'g')
silent execute '!xdg-open ' . trim(opts)
endfunction
set foldmethod=expr
set foldexpr=nvim_treesitter#foldexpr()
lua require 'ui'
lua require 'user.helpers'
lua require 'user.plugins'
lua require 'user.plugins-config'
lua require 'lsp'
lua require 'lsp.null-ls'
execute "source " . g:config_location ."/"."plug-config/welle-targets.vim"
execute "source " . g:config_location ."/"."plug-config/delimitMate.vim"
execute "source " . g:config_location ."/"."plug-config/telescope.vim"
execute "source " . g:config_location ."/"."plug-config/vim-go.vim"
let g:easy_align_delimiters = {
\ '/': {
\ 'pattern':
\ '//\+\s\?' . '\|'.
\ '/\*\+' . '\|'.
\ ' \*/\?',
\ 'delimiter_align': 'l',
\ 'right_margin': -1,
\ },
\ ' ': {
\ 'pattern': '\s',
\ 'left_margin': 0,
\ 'right_margin': 0
\ }
\ }