Skip to content

Commit d710c5e

Browse files
author
Dnotreason
committed
plugin config dir
1 parent 1acff0f commit d710c5e

12 files changed

+295
-1
lines changed

.data/plug-config/Zenburn.vim

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vim9script
2+
3+
# colorscheme zenburn

.data/plug-config/catppuccin.vim

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vim9script
2+

.data/plug-config/ddc.vim

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
vim9script
2+
3+
ddc#custom#patch_global({
4+
ui: 'native',
5+
6+
sources: [ 'omni', 'vsnip', 'around', 'buffer', 'file', ],
7+
8+
sourceOptions: {
9+
_: {
10+
matchers: ['matcher_head'],
11+
sorters: ['sorter_rank'],
12+
minAutoCompleteLength: 1,
13+
},
14+
15+
around: {
16+
mark: 'A',
17+
},
18+
19+
vim: {
20+
mark: 'V',
21+
},
22+
23+
vsnip: {
24+
mark: 'S',
25+
},
26+
27+
omni: {
28+
mark: 'O',
29+
},
30+
31+
file: {
32+
mark: 'F',
33+
isVolatile: true,
34+
forceCompletionPattern: '\S/\S*',
35+
},
36+
37+
buffer: {
38+
mark: 'B',
39+
},
40+
},
41+
42+
sourceParams: {
43+
around: {
44+
maxSize: 500,
45+
},
46+
47+
buffer: {
48+
requireSameFiletype: false,
49+
limitBytes: 5000000,
50+
fromAltBuf: true,
51+
forceCollect: true,
52+
},
53+
},
54+
})
55+
56+
ddc#custom#patch_filetype('vim', {
57+
sources: [ 'omni', 'around', 'vim', 'file', 'buffer', ],
58+
})
59+
60+
# ddc#custom#patch_filetype(['c', 'cpp'], {
61+
# sources: ['around', 'clangd'],
62+
# sourceOptions: {
63+
# clangd: {
64+
# mark: 'C',
65+
# },
66+
# },
67+
# })
68+
69+
ddc#custom#patch_filetype('markdown', {
70+
sourceParams: {
71+
around: {
72+
maxSize: 100
73+
},
74+
},
75+
})
76+
77+
ddc#enable()

.data/plug-config/denops.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
vim9script
2+
3+
4+
# g:denops#deno = '~/.deno/bin/deno'->expand()
5+
6+
g:denops_server_addr = '127.0.0.1:32123'

.data/plug-config/fzf.vim

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
vim9script
2+
#-----------------------------
3+
4+
g:fzf_history_dir = '~/.vim/.state/fzf-history'
5+
6+
7+
def Config()
8+
var config_path = '~/.vim'->expand()
9+
var config_file_list = $'fd . {config_path} -tf'->systemlist()
10+
var relative_config_file_list = config_file_list->map((_, val) => {
11+
return val->strpart(config_path->strlen() + 1)
12+
})
13+
g:fzf#run(g:fzf#wrap({
14+
source: relative_config_file_list,
15+
sink: (line) => {
16+
execute $'tabedit {config_path}/{line}'
17+
},
18+
options: [ '--prompt', 'Open Config File: ', ],
19+
}))
20+
enddef
21+
22+
command -bar Config Config()
23+

.data/plug-config/lightline.vim

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
vim9script
2+
3+
g:lightline = {
4+
colorscheme: 'gruvbox8',
5+
# colorscheme: 'zenburn',
6+
mode_map: {
7+
'n': 'N',
8+
'i': 'I',
9+
'R': 'R',
10+
'v': 'V',
11+
'V': 'VL',
12+
"\<C-v>": 'VB',
13+
'c': 'C',
14+
's': 'S',
15+
'S': 'SL',
16+
"\<C-s>": 'SB',
17+
't': 'T',
18+
},
19+
active: {
20+
left: [
21+
[ 'mode', 'paste' ],
22+
[ 'readonly', 'filename', 'modified' ],
23+
],
24+
right: [
25+
[ 'position', ],
26+
[ 'filetype', ],
27+
[ 'lsp_diag', ],
28+
]
29+
},
30+
component: {
31+
position: '%P:%L',
32+
filetype: '%{&ft != "" ? &ft : ""}',
33+
filetype_icon: '%{&ft != "" ? nerdfont#find() : ""} ',
34+
who: '%{$USER}',
35+
},
36+
component_function: {
37+
lsp_diag: 'LightlineDiag',
38+
},
39+
}
40+
41+
def g:LightlineDiag(): string
42+
if !exists('*lsp#lsp#ErrorCount')
43+
return ''
44+
endif
45+
46+
var diag = lsp#lsp#ErrorCount()
47+
48+
var error = diag['Error'] != 0 ? $'E:{diag['Error']} ' : ''
49+
var warn = diag['Warn'] != 0 ? $'W:{diag['Warn']} ' : ''
50+
var info = diag['Info'] != 0 ? $'I:{diag['Info']} ' : ''
51+
var hint = diag['Hint'] != 0 ? $'H:{diag['Hint']}' : ''
52+
53+
return error .. warn .. info .. hint
54+
enddef
55+
56+

.data/plug-config/lsp.vim

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
vim9script
2+
3+
var lspOpts = {
4+
aleSupport: false,
5+
autoComplete: false,
6+
autoHighlight: false,
7+
autoHighlightDiags: true,
8+
autoPopulateDiags: false,
9+
completionMatcher: 'case',
10+
completionMatcherValue: 1,
11+
diagSignErrorText: 'E>',
12+
diagSignHintText: 'H>',
13+
diagSignInfoText: 'I>',
14+
diagSignWarningText: 'W>',
15+
echoSignature: false,
16+
hideDisabledCodeActions: false,
17+
highlightDiagInline: true,
18+
hoverInPreview: false,
19+
ignoreMissingServer: false,
20+
keepFocusInDiags: true,
21+
keepFocusInReferences: true,
22+
completionTextEdit: false,
23+
diagVirtualTextAlign: 'above',
24+
diagVirtualTextWrap: 'default',
25+
noNewlineInCompletion: false,
26+
omniComplete: true,
27+
outlineOnRight: false,
28+
outlineWinSize: 30,
29+
semanticHighlight: true,
30+
showDiagInBalloon: true,
31+
showDiagInPopup: true,
32+
showDiagOnStatusLine: false,
33+
showDiagWithSign: true,
34+
showDiagWithVirtualText: true,
35+
showInlayHints: true,
36+
showSignature: true,
37+
snippetSupport: false,
38+
ultisnipsSupport: false,
39+
useBufferCompletion: false,
40+
usePopupInCodeAction: true,
41+
useQuickfixForLocations: false,
42+
vsnipSupport: false,
43+
bufferCompletionTimeout: 100,
44+
customCompletionKinds: false,
45+
completionKinds: {},
46+
filterCompletionDuplicates: false,
47+
}
48+
49+
50+
var lspServers = [
51+
# Clangd language server
52+
{
53+
name: 'clang',
54+
filetype: ['c', 'cpp'],
55+
path: 'clangd-mp-17',
56+
args: ['--background-index'],
57+
},
58+
59+
# Rust language server
60+
# {
61+
# name: 'rustlang',
62+
# filetype: ['rust'],
63+
# path: '/usr/local/bin/rust-analyzer',
64+
# args: [],
65+
# syncInit: true,
66+
# },
67+
68+
# Go language server
69+
{
70+
name: 'golang',
71+
filetype: ['go', 'gomod'],
72+
path: 'gopls',
73+
args: ['serve'],
74+
syncInit: true,
75+
initializationOptions: {
76+
semanticTokens: true,
77+
},
78+
},
79+
80+
# Javascript/Typescript language server
81+
{
82+
name: 'typescriptlang',
83+
filetype: ['javascript', 'typescript'],
84+
path: 'typescript-language-server',
85+
args: ['--stdio'],
86+
},
87+
]
88+
89+
augroup Lsp
90+
au!
91+
autocmd User LspSetup call LspOptionsSet(lspOpts)
92+
autocmd User LspSetup call LspAddServer(lspServers)
93+
autocmd User LspAttached {
94+
setlocal keywordprg=:LspHover
95+
setlocal tagfunc=lsp#lsp#TagFunc
96+
setlocal formatexpr=lsp#lsp#FormatExpr()
97+
nnoremap <buffer> <LocalLeader>f <Cmd>LspFormat<CR>
98+
}
99+
augroup END

.data/plug-config/vfiler.vim

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vim9script
2+
#-----------------------------
3+
4+

.data/plug-config/vim-fileheader.vim

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
vim9script
2+
3+
g:fileheader_by_git_config = 0
4+
5+
g:fileheader_author = 'Donotreason'
6+
7+
g:fileheader_show_email = 1
8+
g:fileheader_default_email = '[email protected]'

.data/plug-config/vim-rooter.vim

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
vim9script
2+
#-----------------------------
3+
#
4+
5+
g:rooter_patterns = [ '.git', 'Makefile', 'makefile', ]
6+
7+
g:rooter_change_directory_for_non_project_files = ''
8+
9+
g:rooter_silent_chdir = 1
10+

.data/plug-config/vim-vsnip.vim

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
vim9script
2+
3+
inoremap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
4+
snoremap <expr> <Tab> vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>'
5+
inoremap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'
6+
snoremap <expr> <S-Tab> vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-prev)' : '<S-Tab>'

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
.data/
21
.state/
2+
.data/plug/

0 commit comments

Comments
 (0)