summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2024-07-23 20:26:43 +0100
committerAkshay <[email protected]>2024-07-23 20:26:43 +0100
commitddc6f72c5b1cf6916ef2705b226d0c53950b9386 (patch)
tree56b1d651dfe18a5e45b8cc6477ff8cb49991d98c
init
-rw-r--r--.gitignore3
-rw-r--r--after/syntax/python.vim6
-rw-r--r--after/syntax/scheme.vim19
-rw-r--r--ftdetect/kotlin.vim2
-rw-r--r--ftplugin/asm.vim1
-rw-r--r--ftplugin/go.vim4
-rw-r--r--ftplugin/haskell.vim30
-rw-r--r--ftplugin/javascript.vim8
-rw-r--r--ftplugin/kotlin.vim19
-rw-r--r--ftplugin/python.vim8
-rw-r--r--ftplugin/rust.vim13
-rw-r--r--ftplugin/scheme.vim7
-rw-r--r--ftplugin/tex.vim6
-rw-r--r--ftplugin/typescript.vim7
-rw-r--r--ftplugin/wiki.vim1
l---------init.lua1
-rw-r--r--lua/completions.lua53
-rw-r--r--lua/leap-ast.lua51
-rw-r--r--lua/leap.lua10
-rw-r--r--lua/lsp.lua68
-rw-r--r--lua/treesitter.lua41
-rw-r--r--plugin/help.vim16
-rw-r--r--plugin/ignores.vim11
-rw-r--r--plugin/maps.vim58
-rw-r--r--plugin/statusline.vim137
-rw-r--r--spell/en.utf-8.add22
-rw-r--r--spell/en.utf-8.add.splbin0 -> 375 bytes
-rw-r--r--syntax/kotlin.vim139
-rw-r--r--syntax/proto.vim106
29 files changed, 847 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e883c08
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
1.netrwhist
2after/.netrwhist
3autoload/
diff --git a/after/syntax/python.vim b/after/syntax/python.vim
new file mode 100644
index 0000000..278cdc2
--- /dev/null
+++ b/after/syntax/python.vim
@@ -0,0 +1,6 @@
1syntax keyword pyNiceLambda lambda conceal cchar=λ
2highlight link pyNiceLambda secondAccent
3
4highlight! link Conceal Noise
5
6setlocal conceallevel=1
diff --git a/after/syntax/scheme.vim b/after/syntax/scheme.vim
new file mode 100644
index 0000000..9a2972b
--- /dev/null
+++ b/after/syntax/scheme.vim
@@ -0,0 +1,19 @@
1syntax keyword scmNiceLambda lambda conceal cchar=λ
2
3syntax clear schemeFunction
4
5syntax match scmNiceOperator "<=" conceal cchar=≤
6syntax match scmNiceOperator ">=" conceal cchar=≥
7
8syn region scmNiceQuote matchgroup=secondAccent start=/'[`']*/ end=/[ \t\n()\[\]";]/me=e-1
9syn region scmNiceQuote matchgroup=secondAccent start=/'['`]*"/ skip=/\\[\\"]/ end=/"/
10syn region scmNiceQuote matchgroup=secondAccent start=/'['`]*|/ skip=/\\[\\|]/ end=/|/
11syn region scmNiceQuote matchgroup=secondAccent start=/'['`]*#\?(/ end=/)/ contains=ALLBUT,schemeQuasiquote,schemeQuasiquoteForm,schemeUnquote,schemeForm,schemeDatumCommentForm,schemeImport,@schemeImportCluster,@schemeSyntaxCluster
12
13highlight link scmNiceLambda schemeSyntax
14highlight link scmNiceOperator Noise
15highlight link scmNiceQuote secondAccent
16
17highlight! link Conceal Noise
18
19setlocal conceallevel=1
diff --git a/ftdetect/kotlin.vim b/ftdetect/kotlin.vim
new file mode 100644
index 0000000..6d5ebb7
--- /dev/null
+++ b/ftdetect/kotlin.vim
@@ -0,0 +1,2 @@
1autocmd BufNewFile,BufRead *.kt setfiletype kotlin
2autocmd BufNewFile,BufRead *.kts setfiletype kotlin
diff --git a/ftplugin/asm.vim b/ftplugin/asm.vim
new file mode 100644
index 0000000..dde370b
--- /dev/null
+++ b/ftplugin/asm.vim
@@ -0,0 +1 @@
syntax off
diff --git a/ftplugin/go.vim b/ftplugin/go.vim
new file mode 100644
index 0000000..6efd1fe
--- /dev/null
+++ b/ftplugin/go.vim
@@ -0,0 +1,4 @@
1setlocal noexpandtab
2setlocal autoindent
3setlocal smarttab
4setlocal formatoptions=croql
diff --git a/ftplugin/haskell.vim b/ftplugin/haskell.vim
new file mode 100644
index 0000000..651f033
--- /dev/null
+++ b/ftplugin/haskell.vim
@@ -0,0 +1,30 @@
1function! s:OverwriteBuffer(output)
2 let winview = winsaveview()
3 silent! undojoin
4 normal! gg"_dG
5 call append(0, split(a:output, '\v\n'))
6 normal! G"_dd
7 call winrestview(winview)
8endfunction
9
10function! s:RunStylishHaskell()
11 let output = system("stylish-haskell" . " " . bufname("%"))
12 let errors = matchstr(output, '\(Language\.Haskell\.Stylish\.Parse\.parseModule:[^\x0]*\)')
13 if v:shell_error != 0
14 echom output
15 elseif empty(errors)
16 call s:OverwriteBuffer(output)
17 write
18 else
19 echom errors
20 endif
21endfunction
22
23set formatprg=stylish-haskell
24set makeprg=hlint
25
26augroup HaskellLint
27 autocmd!
28 autocmd BufWritePost *.hs | call s:RunStylishHaskell() | silent make! <afile> | silent redraw!
29 autocmd QuickFixCmdPost [^l]* cwindow
30augroup END
diff --git a/ftplugin/javascript.vim b/ftplugin/javascript.vim
new file mode 100644
index 0000000..454c153
--- /dev/null
+++ b/ftplugin/javascript.vim
@@ -0,0 +1,8 @@
1setlocal tabstop=2
2setlocal shiftwidth=2
3setlocal softtabstop=2
4setlocal formatoptions=croq
5setlocal expandtab
6setlocal autoindent
7setlocal smarttab
8
diff --git a/ftplugin/kotlin.vim b/ftplugin/kotlin.vim
new file mode 100644
index 0000000..d001ac1
--- /dev/null
+++ b/ftplugin/kotlin.vim
@@ -0,0 +1,19 @@
1setlocal tabstop=4
2setlocal softtabstop=4
3setlocal shiftwidth=4
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal formatoptions=croql
8
9setlocal comments=://
10setlocal commentstring=//\ %s
11
12setlocal makeprg=ktlint
13
14augroup KtLint
15 autocmd!
16 autocmd BufWritePost *.kt silent make! <afile> | silent redraw
17 autocmd QuickFixCmdPost [^l]* cwindow
18augroup END
19
diff --git a/ftplugin/python.vim b/ftplugin/python.vim
new file mode 100644
index 0000000..89b7508
--- /dev/null
+++ b/ftplugin/python.vim
@@ -0,0 +1,8 @@
1setlocal tabstop=4
2setlocal softtabstop=4
3setlocal shiftwidth=4
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal formatoptions=croql
8setlocal formatprg=yapf
diff --git a/ftplugin/rust.vim b/ftplugin/rust.vim
new file mode 100644
index 0000000..50645fa
--- /dev/null
+++ b/ftplugin/rust.vim
@@ -0,0 +1,13 @@
1setlocal ts=4 sts=4 sw=4 expandtab
2
3set formatprg=rustfmt
4set errorformat=
5 \%-G,
6 \%-Gerror:\ aborting\ %.%#,
7 \%-Gerror:\ Could\ not\ compile\ %.%#,
8 \%Eerror:\ %m,
9 \%Eerror[E%n]:\ %m,
10 \%Wwarning:\ %m,
11 \%Inote:\ %m,
12 \%C\ %#-->\ %f:%l:%c,
13 \%E\ \ left:%m,%C\ right:%m\ %f:%l:%c,%Z
diff --git a/ftplugin/scheme.vim b/ftplugin/scheme.vim
new file mode 100644
index 0000000..784bf29
--- /dev/null
+++ b/ftplugin/scheme.vim
@@ -0,0 +1,7 @@
1setlocal tabstop=2
2setlocal softtabstop=2
3setlocal shiftwidth=2
4setlocal expandtab
5setlocal autoindent
6setlocal smarttab
7setlocal formatoptions=croql
diff --git a/ftplugin/tex.vim b/ftplugin/tex.vim
new file mode 100644
index 0000000..515fb7a
--- /dev/null
+++ b/ftplugin/tex.vim
@@ -0,0 +1,6 @@
1setlocal wrap
2setlocal number
3nnoremap j gj
4nnoremap k gk
5let g:tex_conceal="abdmgs"
6let g:tex_fold_enabled=1
diff --git a/ftplugin/typescript.vim b/ftplugin/typescript.vim
new file mode 100644
index 0000000..c6132bb
--- /dev/null
+++ b/ftplugin/typescript.vim
@@ -0,0 +1,7 @@
1setlocal tabstop=2
2setlocal shiftwidth=2
3setlocal softtabstop=2
4setlocal formatoptions=croq
5setlocal expandtab
6setlocal autoindent
7setlocal smarttab
diff --git a/ftplugin/wiki.vim b/ftplugin/wiki.vim
new file mode 100644
index 0000000..88a5339
--- /dev/null
+++ b/ftplugin/wiki.vim
@@ -0,0 +1 @@
set textwidth=72
diff --git a/init.lua b/init.lua
new file mode 120000
index 0000000..a230fe7
--- /dev/null
+++ b/init.lua
@@ -0,0 +1 @@
/nix/store/7krz5l0yqf14bigxxc8m1va9bmkq0qq0-home-manager-files/.config/nvim/init.lua \ No newline at end of file
diff --git a/lua/completions.lua b/lua/completions.lua
new file mode 100644
index 0000000..bd90178
--- /dev/null
+++ b/lua/completions.lua
@@ -0,0 +1,53 @@
1local cmp = require 'cmp'
2
3cmp.setup({
4 snippet = {
5 expand = function(args) end,
6 },
7 mapping = {
8 ['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
9 ['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
10 ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
11 ['<C-y>'] = cmp.config.disable,
12 ['<C-e>'] = cmp.mapping({
13 i = cmp.mapping.abort(),
14 c = cmp.mapping.close(),
15 }),
16 ['<CR>'] = cmp.mapping.confirm({ select = true }),
17
18 ['<C-n>'] = cmp.mapping(function(fallback)
19 if cmp.visible() then
20 cmp.select_next_item()
21 else
22 fallback()
23 end
24 end, { 'i', 's', 'c' }),
25
26 ['<C-p>'] = cmp.mapping(function(fallback)
27 if cmp.visible() then
28 cmp.select_prev_item()
29 else
30 fallback()
31 end
32 end, { 'i', 's', 'c' }),
33 },
34 sources = cmp.config.sources({
35 { name = 'nvim_lsp' },
36 }, {
37 { name = 'buffer' },
38 })
39})
40
41cmp.setup.cmdline('/', {
42 sources = {
43 { name = 'buffer' }
44 }
45})
46
47cmp.setup.cmdline(':', {
48 sources = cmp.config.sources({
49 { name = 'path' }
50 }, {
51 { name = 'cmdline' }
52 })
53})
diff --git a/lua/leap-ast.lua b/lua/leap-ast.lua
new file mode 100644
index 0000000..22a5876
--- /dev/null
+++ b/lua/leap-ast.lua
@@ -0,0 +1,51 @@
1local api = vim.api
2-- Note: The functions used here will be upstreamed eventually.
3local ts_utils = require('nvim-treesitter.ts_utils')
4
5local function get_ast_nodes()
6 local wininfo = vim.fn.getwininfo(api.nvim_get_current_win())[1]
7 -- Get current TS node.
8 local cur_node = ts_utils.get_node_at_cursor(0)
9 if not cur_node then return end
10 -- Get parent nodes recursively.
11 local nodes = { cur_node }
12 local parent = cur_node:parent()
13 while parent do
14 table.insert(nodes, parent)
15 parent = parent:parent()
16 end
17 -- Create Leap targets from TS nodes.
18 local targets = {}
19 local startline, startcol
20 for _, node in ipairs(nodes) do
21 startline, startcol, _, _ = node:range() -- (0,0)
22 if startline + 1 >= wininfo.topline then
23 local target = { node = node, pos = { startline + 1, startcol + 1 } }
24 table.insert(targets, target)
25 end
26 end
27 if #targets >= 1 then return targets end
28end
29
30local function select_range(target)
31 local mode = api.nvim_get_mode().mode
32 if not mode:match('n?o') then
33 -- Force going back to Normal (implies mode = v | V | ).
34 vim.cmd('normal! ' .. mode)
35 end
36 ts_utils.update_selection(0, target.node,
37 mode:match('V') and 'linewise' or
38 mode:match('') and 'blockwise' or
39 'charwise'
40 )
41end
42
43local function leap()
44 require('leap').leap {
45 targets = get_ast_nodes(),
46 action = api.nvim_get_mode().mode ~= 'n' and select_range, -- or jump
47 backward = true
48 }
49end
50
51return { leap = leap }
diff --git a/lua/leap.lua b/lua/leap.lua
new file mode 100644
index 0000000..14be3bd
--- /dev/null
+++ b/lua/leap.lua
@@ -0,0 +1,10 @@
1local leap = require 'leap'
2leap.opts.safe_labels = {}
3leap.opts.labels = {
4 "a", "r", "s", "t", "n", "e", "i", "o", "d", "h",
5 "A", "R", "S", "T", "N", "E", "I", "O", "D", "H"
6}
7leap.opts.special_keys = {
8 next_target = '<c-n>',
9 prev_target = '<c-p>',
10}
diff --git a/lua/lsp.lua b/lua/lsp.lua
new file mode 100644
index 0000000..349c719
--- /dev/null
+++ b/lua/lsp.lua
@@ -0,0 +1,68 @@
1local nvim_lsp = require('lspconfig')
2local on_attach = function(client, bufnr)
3 local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
4 local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
5
6 buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
7
8 -- Mappings.
9 local bufopts = { noremap=true, silent=true, buffer=bufnr }
10 vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
11 vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
12 vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
13 vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
14 vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
15
16 local opts = { noremap=true, silent=true }
17 vim.keymap.set('n', '<space>d', vim.diagnostic.open_float, opts)
18 vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
19 vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
20 vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
21 vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
22end
23
24local servers = { "hls", "bashls" }
25for _, lsp in ipairs(servers) do
26 nvim_lsp[lsp].setup {
27 on_attach = on_attach,
28 }
29end
30
31local capabilities = require('cmp_nvim_lsp')
32 .default_capabilities(vim.lsp.protocol.make_client_capabilities())
33
34capabilities.textDocument.completion.completionItem.snippetSupport = true
35
36-- nvim_lsp.rust_analyzer.setup {
37-- on_attach = on_attach,
38-- settings = {
39-- ["rust-analyzer"] = {
40-- procMacro = {
41-- enable = true
42-- },
43-- cargo = {
44-- allFeatures = false,
45-- },
46-- checkOnSave = false,
47-- },
48-- },
49-- }
50
51nvim_lsp.ccls.setup {
52 capabilities = capabilities,
53 on_attach = on_attach,
54 init_options = {
55 index = {
56 threads = 0;
57 };
58 clang = {
59 extraArgs = { "-fopenmp" };
60 excludeArgs = { "-frounding-math" } ;
61 };
62 }
63}
64
65nvim_lsp.jdtls.setup{
66 cmd = {"jdtls"};
67}
68
diff --git a/lua/treesitter.lua b/lua/treesitter.lua
new file mode 100644
index 0000000..f63cb3b
--- /dev/null
+++ b/lua/treesitter.lua
@@ -0,0 +1,41 @@
1require'nvim-treesitter.configs'.setup {
2 highlight = {
3 enable = false,
4 -- disable = { "c"},
5 },
6 incremental_selection = {
7 enable = true,
8 keymaps = {
9 init_selection = "gnn",
10 node_incremental = "g}",
11 scope_incremental = "grc",
12 node_decremental = "g{",
13 },
14 },
15 indent = {
16 enable = false
17 },
18 playground = {
19 enable = true,
20 disable = {},
21 updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
22 persist_queries = false, -- Whether the query persists across vim sessions
23 keybindings = {
24 toggle_query_editor = 'o',
25 toggle_hl_groups = 'i',
26 toggle_injected_languages = 't',
27 toggle_anonymous_nodes = 'a',
28 toggle_language_display = 'I',
29 focus_language = 'f',
30 unfocus_language = 'F',
31 update = 'R',
32 goto_node = '<cr>',
33 show_help = '?',
34 },
35 },
36 query_linter = {
37 enable = true,
38 use_virtual_text = true,
39 lint_events = {"BufWrite", "CursorHold"},
40 },
41}
diff --git a/plugin/help.vim b/plugin/help.vim
new file mode 100644
index 0000000..decdab6
--- /dev/null
+++ b/plugin/help.vim
@@ -0,0 +1,16 @@
1" Only apply to .txt files...
2augroup HelpInTabs
3 autocmd!
4 autocmd BufEnter *.txt call HelpInNewTab()
5augroup END
6
7" Only apply to help files...
8function! HelpInNewTab ()
9 if &buftype == 'help' && g:help_in_tabs
10 "Convert the help window to a tab...
11 execute "normal \<C-W>T"
12 endif
13endfunction
14
15let g:help_in_tabs = 0
16
diff --git a/plugin/ignores.vim b/plugin/ignores.vim
new file mode 100644
index 0000000..3ab37f0
--- /dev/null
+++ b/plugin/ignores.vim
@@ -0,0 +1,11 @@
1set wildignore+=.git,.hg,.svn
2set wildignore+=*.aux,*.out,*.toc
3set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
4set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
5set wildignore+=*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
6set wildignore+=*.mp3,*.oga,*.ogg,*.wav,*.flac
7set wildignore+=*.eot,*.otf,*.ttf,*.woff
8set wildignore+=*.doc,*.pdf,*.cbr,*.cbz
9set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
10set wildignore+=*.swp,.lock,.DS_Store,._*
11
diff --git a/plugin/maps.vim b/plugin/maps.vim
new file mode 100644
index 0000000..b61e994
--- /dev/null
+++ b/plugin/maps.vim
@@ -0,0 +1,58 @@
1mapclear
2
3let mapleader=' '
4
5" clipboard
6map <leader>cc :w !xclip -sel c<CR>
7
8" normal
9nnoremap <Leader>o : only<cr>
10nnoremap - : b#<cr>
11nnoremap <Leader>b : Buffers<cr>
12nnoremap <Leader>n : bnext<cr>
13nnoremap <Leader>p : bprev<cr>
14nnoremap <Leader>z : FZF<cr>
15nnoremap <Leader>l : Lines<cr>
16nnoremap <Leader>e : Explore<cr>
17nnoremap <Leader>t : call GetTabber()<cr>
18nnoremap <Leader><ESC> : nohlsearch<cr>
19nnoremap <C-l> :nohlsearch<cr>:diffupdate<cr>:syntax sync fromstart<cr><c-l>
20nnoremap H H:exec 'norm! '. &scrolloff . 'k'<cr>
21nnoremap L L:exec 'norm! '. &scrolloff . 'j'<cr>
22nnoremap <expr> gb '`[' . strpart(getregtype(), 0, 1) . '`]'
23
24
25nnoremap <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
26 \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
27 \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
28
29nnoremap <Leader>s <Plug>(leap-forward-to)
30nnoremap <Leader>S <Plug>(leap-backward-to)
31
32cmap w!! %!sudo -S tee > /dev/null %
33
34" visual
35vnoremap > >gv
36vnoremap < <gv
37vnoremap <silent> * :<C-U>
38 \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
39 \gvy/<C-R>=&ic?'\c':'\C'<CR><C-R><C-R>=substitute(
40 \escape(@", '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
41 \gVzv:call setreg('"', old_reg, old_regtype)<CR>
42vnoremap <silent> # :<C-U>
43 \let old_reg=getreg('"')<Bar>let old_regtype=getregtype('"')<CR>
44 \gvy?<C-R>=&ic?'\c':'\C'<CR><C-R><C-R>=substitute(
45 \escape(@", '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')<CR><CR>
46 \gVzv:call setreg('"', old_reg, old_regtype)<CR>
47
48" operator-pending
49onoremap ax a`
50onoremap ix i`
51
52" visual block
53xnoremap + g<C-a>
54xnoremap - g<C-x>
55
56" completions
57inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
58inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
diff --git a/plugin/statusline.vim b/plugin/statusline.vim
new file mode 100644
index 0000000..a5264a4
--- /dev/null
+++ b/plugin/statusline.vim
@@ -0,0 +1,137 @@
1scriptencoding utf-8
2
3" statusline
4
5let g:currentmode={
6 \ 'n' : 'NORMAL ',
7 \ 'no' : 'N·OPERATOR PENDING ',
8 \ 'v' : 'VISUAL ',
9 \ 'V' : 'V·LINE ',
10 \ '' : 'V·BLOCK ',
11 \ 's' : 'SELECT ',
12 \ 'S' : 'S·LINE ',
13 \ '' : 'S·BLOCK ',
14 \ 'i' : 'INSERT ',
15 \ 'R' : 'REPLACE ',
16 \ 'Rv' : 'V·REPLACE ',
17 \ 'c' : 'COMMAND ',
18 \ 'cv' : 'VIM EX ',
19 \ 'ce' : 'EX ',
20 \ 'r' : 'PROMPT ',
21 \ 'rm' : 'MORE ',
22 \ 'r?' : 'CONFIRM ',
23 \ '!' : 'SHELL ',
24 \ 't' : 'TERMINAL '}
25
26hi PrimaryBlock ctermfg=00 ctermbg=6
27hi SecondaryBlock ctermfg=07 ctermbg=10
28hi Blanks ctermfg=08 ctermbg=0
29
30hi User1 ctermfg=01 ctermbg=0
31hi User2 ctermfg=02 ctermbg=0
32hi User3 ctermfg=03 ctermbg=0
33hi User4 ctermfg=12 ctermbg=0
34hi User5 ctermfg=05 ctermbg=0
35hi User6 ctermfg=06 ctermbg=0
36hi User7 ctermfg=07 ctermbg=0
37hi User8 ctermfg=08 ctermbg=0
38hi User9 ctermfg=00 ctermbg=0
39
40highlight EndOfBuffer ctermfg=black ctermbg=black
41
42function! ReadOnly() abort
43 if !&modifiable && &readonly
44 return ' RO'
45 elseif &modifiable && &readonly
46 return 'RO'
47 elseif !&modifiable && !&readonly
48 return ''
49 else
50 return ''
51 endif
52endfunction
53
54function! Filepath() abort
55 let l:basename = expand('%:h')
56 let l:filename = expand('%:t')
57 let l:extension = expand('%:e')
58 let l:prefix = (l:basename ==# '' || l:basename ==# '.') ?
59 \ '' : substitute(l:basename . '/', '\C^' . $HOME, '~', '')
60
61 if empty(l:prefix) && empty(l:filename)
62 return printf('%%4*%%f%%*%s %%m%%*', '%4*')
63 elseif empty(l:prefix)
64 return printf('%%4*%%f%%*%s %%m%%*', '%6*')
65 else
66 return printf('%%4*%s%%*%s%s%%*', l:prefix, &modified ? '%6*' : '%4*', l:filename)
67 endif
68endfunction
69
70function! QuickFixStatus() abort
71 let l:qfl=getqflist()
72 let l:qftitle = getqflist({'title' : 0}).title
73 if len(qfl) != 0
74 return l:qftitle
75 else
76 return ''
77endfunction
78
79function! LinterStatus() abort
80 let sl = ''
81 let msgs = []
82 if luaeval('not vim.tbl_isempty(vim.lsp.buf_get_clients(0))')
83 let errs = luaeval("#vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })")
84 let warns = luaeval("#vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })")
85 if errs != 0
86 call add(msgs, printf('%%5*%s×%%* ', errs))
87 endif
88 if warns != 0
89 call add(msgs, printf('%%3*%s!%%* ', warns))
90 endif
91 return join(msgs, '')
92 else
93 return ''
94 endif
95endfunction
96
97function! StatusLine(mode) abort
98 let l:line=''
99
100 " help or man pages
101 if &filetype ==# 'help' || &filetype ==# 'man'
102 let l:line.=' %#StatusLineNC# ['. &filetype .'] %f '
103 return l:line
104 endif
105
106 " active
107 if a:mode ==# 'active'
108 let l:line.=Filepath()
109 let l:line.='%5*'
110 let l:line.=QuickFixStatus()
111
112 let l:line.='%5*'
113 let l:line.=' %{ReadOnly()} %w%*'
114 let l:line.='%9* %=%*'
115
116 let l:line.=' ' . '%7*%l,%c%*' . ' '
117 let l:line.=LinterStatus()
118 let l:line.='%4*'. &filetype
119
120 else
121 " inactive
122 let l:line.='%#Blanks#'
123 let l:line.='%f %5*%m%*'
124 let l:line.='%#Blanks# %=%*'
125 endif
126
127 let l:line.='%*'
128
129 return l:line
130endfunction
131
132set statusline=%!StatusLine('active')
133augroup MyStatusLine
134 autocmd!
135 autocmd WinEnter * setl statusline=%!StatusLine('active')
136 autocmd WinLeave * setl statusline=%!StatusLine('inactive')
137augroup END
diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add
new file mode 100644
index 0000000..333c6d8
--- /dev/null
+++ b/spell/en.utf-8.add
@@ -0,0 +1,22 @@
1metadata
2ImageInformationHeader
3Ramayana
4Narayana
5Garuda
6Iravata
7Sita
8Kakasura
9Ramayanam
10Dasaratha
11Ayodhya
12Ravana
13Rakshasa
14Hanuman
15dharma
16Pandu
17Pandavas
18Vasudeva
19Devaki
20Rakshasas
21right
22#xersice
diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl
new file mode 100644
index 0000000..6ec00f8
--- /dev/null
+++ b/spell/en.utf-8.add.spl
Binary files differ
diff --git a/syntax/kotlin.vim b/syntax/kotlin.vim
new file mode 100644
index 0000000..48fc6ce
--- /dev/null
+++ b/syntax/kotlin.vim
@@ -0,0 +1,139 @@
1" Vim syntax file
2" Language: Kotlin
3" Maintainer: Alexander Udalov
4" Latest Revision: 13 July 2020
5
6if exists('b:current_syntax')
7 finish
8endif
9
10syn keyword ktStatement break continue return
11syn keyword ktConditional if else when
12syn keyword ktRepeat do for while
13syn keyword ktOperator in is by
14syn keyword ktKeyword get set out super this where
15syn keyword ktException try catch finally throw
16
17syn keyword ktInclude import package
18
19" The following is generated by generate-stdlib-class-names.main.kts
20syn keyword ktType AbstractCollection AbstractCoroutineContextElement AbstractCoroutineContextKey AbstractDoubleTimeSource AbstractIterator AbstractList AbstractLongTimeSource
21syn keyword ktType AbstractMap AbstractMutableCollection AbstractMutableList AbstractMutableMap AbstractMutableSet AbstractSet AccessDeniedException Accessor Annotation
22syn keyword ktType AnnotationRetention AnnotationTarget Any Appendable ArithmeticException Array ArrayDeque ArrayList AssertionError Boolean BooleanArray BooleanIterator
23syn keyword ktType BuilderInference Byte ByteArray ByteIterator CallsInPlace CancellationException Char CharArray CharCategory CharDirectionality CharIterator CharProgression
24syn keyword ktType CharRange CharSequence CharacterCodingException Charsets ClassCastException Cloneable ClosedFloatingPointRange ClosedRange Collection Comparable Comparator
25syn keyword ktType ConcurrentModificationException ConditionalEffect Continuation ContinuationInterceptor ContractBuilder CoroutineContext DeepRecursiveFunction DeepRecursiveScope
26syn keyword ktType Delegates Deprecated DeprecatedSinceKotlin DeprecationLevel Destructured Double DoubleArray DoubleIterator DslMarker Duration DurationUnit Effect Element
27syn keyword ktType EmptyCoroutineContext Entry Enum Error Exception Experimental ExperimentalContracts ExperimentalJsExport ExperimentalMultiplatform ExperimentalStdlibApi
28syn keyword ktType ExperimentalTime ExperimentalTypeInference ExperimentalUnsignedTypes ExtensionFunctionType FileAlreadyExistsException FileSystemException FileTreeWalk
29syn keyword ktType FileWalkDirection Float FloatArray FloatIterator Function Function0 Function1 Function10 Function11 Function12 Function13 Function14 Function15 Function16
30syn keyword ktType Function17 Function18 Function19 Function2 Function20 Function21 Function22 Function3 Function4 Function5 Function6 Function7 Function8 Function9 FunctionN
31syn keyword ktType Getter Grouping HashMap HashSet IllegalArgumentException IllegalStateException IndexOutOfBoundsException IndexedValue Int IntArray IntIterator IntProgression
32syn keyword ktType IntRange InvocationKind Iterable Iterator JsExport JsName JvmDefault JvmDefaultWithoutCompatibility JvmField JvmMultifileClass JvmName JvmOverloads JvmStatic
33syn keyword ktType JvmSuppressWildcards JvmSynthetic JvmWildcard KAnnotatedElement KCallable KClass KClassifier KDeclarationContainer KFunction KMutableProperty KMutableProperty0
34syn keyword ktType KMutableProperty1 KMutableProperty2 KParameter KProperty KProperty0 KProperty1 KProperty2 KType KTypeParameter KTypeProjection KVariance KVisibility Key Kind
35syn keyword ktType KotlinNullPointerException KotlinReflectionNotSupportedError KotlinVersion Lazy LazyThreadSafetyMode Level LinkedHashMap LinkedHashSet List ListIterator Long
36syn keyword ktType LongArray LongIterator LongProgression LongRange Map MatchGroup MatchGroupCollection MatchNamedGroupCollection MatchResult Metadata Monotonic MustBeDocumented
37syn keyword ktType MutableCollection MutableEntry MutableIterable MutableIterator MutableList MutableListIterator MutableMap MutableSet NoSuchElementException NoSuchFileException
38syn keyword ktType NoWhenBranchMatchedException NotImplementedError Nothing NullPointerException Number NumberFormatException ObservableProperty OnErrorAction OptIn
39syn keyword ktType OptionalExpectation OverloadResolutionByLambdaReturnType Pair ParameterName PropertyDelegateProvider PublishedApi PurelyImplements Random RandomAccess
40syn keyword ktType ReadOnlyProperty ReadWriteProperty Regex RegexOption Repeatable ReplaceWith RequiresOptIn RestrictsSuspension Result Retention Returns ReturnsNotNull
41syn keyword ktType RuntimeException Sequence SequenceScope Set Setter SharedImmutable Short ShortArray ShortIterator SimpleEffect SinceKotlin Strictfp String StringBuilder Suppress
42syn keyword ktType Synchronized Target TestTimeSource ThreadLocal Throwable Throws TimeMark TimeSource TimedValue Transient Triple TypeCastException Typography UByte UByteArray
43syn keyword ktType UByteIterator UInt UIntArray UIntIterator UIntProgression UIntRange ULong ULongArray ULongIterator ULongProgression ULongRange UShort UShortArray UShortIterator
44syn keyword ktType UninitializedPropertyAccessException Unit UnsafeVariance UnsupportedOperationException UseExperimental Volatile
45
46syn keyword ktModifier annotation companion enum inner internal private protected public abstract final open override sealed vararg dynamic expect actual
47syn keyword ktStructure class object interface typealias fun val var constructor init
48
49syn keyword ktReservedKeyword typeof
50
51syn keyword ktBoolean true false
52syn keyword ktConstant null
53
54syn keyword ktModifier data tailrec lateinit reified external inline noinline crossinline const operator infix suspend
55
56syn match ktOperator "\v\?:|::|\<\=? | \>\=?|[!=]\=\=?|<as>\??|[-!%&*+/|]"
57
58syn keyword ktTodo TODO FIXME XXX contained
59syn match ktShebang "\v^#!.*$"
60syn match ktLineComment "\v//.*$" contains=ktTodo,@Spell
61syn region ktComment matchgroup=ktCommentMatchGroup start="/\*" end="\*/" contains=ktComment,ktTodo,@Spell
62
63syn region ktDocComment start="/\*\*" end="\*/" contains=ktDocTag,ktTodo,@Spell
64syn match ktDocTag "\v\@(author|constructor|receiver|return|since|suppress)>" contained
65syn match ktDocTag "\v\@(exception|param|property|throws|see|sample)>\s*\S+" contains=ktDocTagParam contained
66syn match ktDocTagParam "\v(\s|\[)\S+" contained
67syn match ktComment "/\*\*/"
68
69syn match ktSpecialCharError "\v\\." contained
70syn match ktSpecialChar "\v\\([tbnr'"$\\]|u\x{4})" contained
71syn region ktString start='"' skip='\\"' end='"' contains=ktSimpleInterpolation,ktComplexInterpolation,ktSpecialChar,ktSpecialCharError
72syn region ktString start='"""' end='""""*' contains=ktSimpleInterpolation,ktComplexInterpolation
73syn match ktCharacter "\v'[^']*'" contains=ktSpecialChar,ktSpecialCharError
74syn match ktCharacter "\v'\\''" contains=ktSpecialChar
75syn match ktCharacter "\v'[^\\]'"
76
77" TODO: highlight label in 'this@Foo'
78syn match ktAnnotation "\v(\w)@<!\@[[:alnum:]_.]*(:[[:alnum:]_.]*)?"
79syn match ktLabel "\v\w+\@"
80
81syn match ktSimpleInterpolation "\v\$\h\w*" contained
82syn region ktComplexInterpolation matchgroup=ktComplexInterpolationBrace start="\v\$\{" end="\v\}" contains=ALLBUT,ktSimpleInterpolation,ktTodo,ktSpecialCharError,ktSpecialChar,ktDocTag,ktDocTagParam
83
84syn match ktNumber "\v<\d+[_[:digit:]]*(uL?|UL?|[LFf])?"
85syn match ktNumber "\v<0[Xx]\x+[_[:xdigit:]]*(uL?|UL?|L)?"
86syn match ktNumber "\v<0[Bb][01]+[_01]*(uL?|UL?|L)?"
87syn match ktFloat "\v<\d*(\d[eE][-+]?\d+|\.\d+([eE][-+]?\d+)?)[Ff]?"
88
89syn match ktEscapedName "\v`.*`"
90
91syn match ktExclExcl "!!"
92syn match ktArrow "->"
93
94hi def link ktStatement Statement
95hi def link ktConditional Conditional
96hi def link ktRepeat Repeat
97hi def link ktOperator Operator
98hi def link ktKeyword Keyword
99hi def link ktException Exception
100hi def link ktReservedKeyword Error
101
102hi def link ktInclude Include
103
104hi def link ktType Type
105hi def link ktModifier StorageClass
106hi def link ktStructure Structure
107hi def link ktTypedef Typedef
108
109hi def link ktBoolean Boolean
110hi def link ktConstant Constant
111
112hi def link ktTodo Todo
113hi def link ktShebang Comment
114hi def link ktLineComment Comment
115hi def link ktComment Comment
116hi def link ktCommentMatchGroup Comment
117hi def link ktDocComment Comment
118hi def link ktDocTag Special
119hi def link ktDocTagParam Identifier
120
121hi def link ktSpecialChar SpecialChar
122hi def link ktSpecialCharError Error
123hi def link ktString String
124hi def link ktCharacter Character
125
126hi def link ktAnnotation Identifier
127hi def link ktLabel Identifier
128
129hi def link ktSimpleInterpolation Identifier
130hi def link ktComplexInterpolationBrace Identifier
131
132hi def link ktNumber Number
133hi def link ktFloat Float
134
135hi def link ktExclExcl Special
136hi def link ktArrow Structure
137
138let b:current_syntax = 'kotlin'
139
diff --git a/syntax/proto.vim b/syntax/proto.vim
new file mode 100644
index 0000000..8545631
--- /dev/null
+++ b/syntax/proto.vim
@@ -0,0 +1,106 @@
1" Protocol Buffers - Google's data interchange format
2" Copyright 2008 Google Inc. All rights reserved.
3" https://developers.google.com/protocol-buffers/
4"
5" Redistribution and use in source and binary forms, with or without
6" modification, are permitted provided that the following conditions are
7" met:
8"
9" * Redistributions of source code must retain the above copyright
10" notice, this list of conditions and the following disclaimer.
11" * Redistributions in binary form must reproduce the above
12" copyright notice, this list of conditions and the following disclaimer
13" in the documentation and/or other materials provided with the
14" distribution.
15" * Neither the name of Google Inc. nor the names of its
16" contributors may be used to endorse or promote products derived from
17" this software without specific prior written permission.
18"
19" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31" This is the Vim syntax file for Google Protocol Buffers.
32"
33" Usage:
34"
35" 1. cp proto.vim ~/.vim/syntax/
36" 2. Add the following to ~/.vimrc:
37"
38" augroup filetype
39" au! BufRead,BufNewFile *.proto setfiletype proto
40" augroup end
41"
42" Or just create a new file called ~/.vim/ftdetect/proto.vim with the
43" previous lines on it.
44
45if version < 600
46 syntax clear
47elseif exists("b:current_syntax")
48 finish
49endif
50
51syn case match
52
53syn keyword pbTodo contained TODO FIXME XXX
54syn cluster pbCommentGrp contains=pbTodo
55
56syn keyword pbSyntax syntax import option
57syn keyword pbStructure package message group oneof
58syn keyword pbRepeat optional required repeated
59syn keyword pbDefault default
60syn keyword pbExtend extend extensions to max reserved
61syn keyword pbRPC service rpc returns
62
63syn keyword pbType int32 int64 uint32 uint64 sint32 sint64
64syn keyword pbType fixed32 fixed64 sfixed32 sfixed64
65syn keyword pbType float double bool string bytes
66syn keyword pbTypedef enum
67syn keyword pbBool true false
68
69syn match pbInt /-\?\<\d\+\>/
70syn match pbInt /\<0[xX]\x+\>/
71syn match pbFloat /\<-\?\d*\(\.\d*\)\?/
72syn region pbComment start="\/\*" end="\*\/" contains=@pbCommentGrp
73syn region pbComment start="//" skip="\\$" end="$" keepend contains=@pbCommentGrp
74syn region pbString start=/"/ skip=/\\./ end=/"/
75syn region pbString start=/'/ skip=/\\./ end=/'/
76
77if version >= 508 || !exists("did_proto_syn_inits")
78 if version < 508
79 let did_proto_syn_inits = 1
80 command -nargs=+ HiLink hi link <args>
81 else
82 command -nargs=+ HiLink hi def link <args>
83 endif
84
85 HiLink pbTodo Todo
86
87 HiLink pbSyntax Include
88 HiLink pbStructure Structure
89 HiLink pbRepeat Repeat
90 HiLink pbDefault Keyword
91 HiLink pbExtend Keyword
92 HiLink pbRPC Keyword
93 HiLink pbType Type
94 HiLink pbTypedef Typedef
95 HiLink pbBool Boolean
96
97 HiLink pbInt Number
98 HiLink pbFloat Float
99 HiLink pbComment Comment
100 HiLink pbString String
101
102 delcommand HiLink
103endif
104
105let b:current_syntax = "proto"
106