fix: properly set gitignore syntax
This commit is contained in:
parent
859e9cf239
commit
976198b82c
33
dots/.config/.gitignore
vendored
33
dots/.config/.gitignore
vendored
@ -1,17 +1,16 @@
|
||||
*/
|
||||
*
|
||||
!./nvim
|
||||
!./zathura
|
||||
!./chrome-flags.conf
|
||||
!./chromium-flags.conf
|
||||
!./bat
|
||||
!./hypr
|
||||
!./mako
|
||||
!./mpv
|
||||
!./waybar
|
||||
!./silicon
|
||||
!./powershell
|
||||
!./wezterm
|
||||
!./wofi
|
||||
!./kitty
|
||||
!./emacs
|
||||
/*
|
||||
!nvim
|
||||
!zathura
|
||||
!chrome-flags.conf
|
||||
!chromium-flags.conf
|
||||
!bat
|
||||
!hypr
|
||||
!mako
|
||||
!mpv
|
||||
!waybar
|
||||
!silicon
|
||||
!powershell
|
||||
!wezterm
|
||||
!wofi
|
||||
!kitty
|
||||
!emacs
|
||||
|
3
dots/.config/nvim/after/ftplugin/Dockerfile.lua
Normal file
3
dots/.config/nvim/after/ftplugin/Dockerfile.lua
Normal file
@ -0,0 +1,3 @@
|
||||
local file_loc = vim.fn.expand("%:p:h")
|
||||
|
||||
vim.opt_local.makeprg = "docker build " .. file_loc
|
1
dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua
Normal file
1
dots/.config/nvim/after/ftplugin/NeogitCommitMessage.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.filetype = "gitcommit"
|
1
dots/.config/nvim/after/ftplugin/Outline.lua
Normal file
1
dots/.config/nvim/after/ftplugin/Outline.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.list = false
|
1
dots/.config/nvim/after/ftplugin/azure.lua
Normal file
1
dots/.config/nvim/after/ftplugin/azure.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.filetype = "yaml"
|
1
dots/.config/nvim/after/ftplugin/cs.lua
Normal file
1
dots/.config/nvim/after/ftplugin/cs.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.api.nvim_buf_set_option(0, "commentstring", "// %s")
|
4
dots/.config/nvim/after/ftplugin/css.lua
Normal file
4
dots/.config/nvim/after/ftplugin/css.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
1
dots/.config/nvim/after/ftplugin/gitconfig.lua
Normal file
1
dots/.config/nvim/after/ftplugin/gitconfig.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt.expandtab = false
|
2
dots/.config/nvim/after/ftplugin/html.lua
Normal file
2
dots/.config/nvim/after/ftplugin/html.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
11
dots/.config/nvim/after/ftplugin/http.lua
Normal file
11
dots/.config/nvim/after/ftplugin/http.lua
Normal file
@ -0,0 +1,11 @@
|
||||
vim.keymap.set("n", "<leader>fr", "<Plug>RestNvim", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fp", "<Plug>RestNvimPreview", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fl", "<Plug>RestNvimLast", {
|
||||
buffer = true,
|
||||
})
|
||||
|
||||
vim.api.nvim_buf_set_option(0, "commentstring", "# %s")
|
1
dots/.config/nvim/after/ftplugin/jinja2.lua
Normal file
1
dots/.config/nvim/after/ftplugin/jinja2.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.api.nvim_buf_set_option(0, "commentstring", "{# %s #}")
|
5
dots/.config/nvim/after/ftplugin/json.lua
Normal file
5
dots/.config/nvim/after/ftplugin/json.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.conceallevel = 0
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
1
dots/.config/nvim/after/ftplugin/make.lua
Normal file
1
dots/.config/nvim/after/ftplugin/make.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.expandtab = false
|
4
dots/.config/nvim/after/ftplugin/markdown.lua
Normal file
4
dots/.config/nvim/after/ftplugin/markdown.lua
Normal file
@ -0,0 +1,4 @@
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
||||
vim.opt_local.textwidth = 0
|
||||
vim.opt_local.conceallevel = 0
|
6
dots/.config/nvim/after/ftplugin/nix.lua
Normal file
6
dots/.config/nvim/after/ftplugin/nix.lua
Normal file
@ -0,0 +1,6 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
||||
|
||||
vim.api.nvim_buf_set_option(0, "commentstring", "# %s")
|
8
dots/.config/nvim/after/ftplugin/norg.lua
Normal file
8
dots/.config/nvim/after/ftplugin/norg.lua
Normal file
@ -0,0 +1,8 @@
|
||||
vim.keymap.set("n", "<leader>fge", ":Neorg gtd edit<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fgv", ":Neorg gtd views<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
|
||||
vim.opt_local.shiftwidth = 2
|
30
dots/.config/nvim/after/ftplugin/rust.lua
Normal file
30
dots/.config/nvim/after/ftplugin/rust.lua
Normal file
@ -0,0 +1,30 @@
|
||||
vim.keymap.set("n", "<leader>fr", ":RustRunnables<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fd", ":RustDebuggables<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fp", ":RustParentModule<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fJ", ":RustJoinLines<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fh", ":RustHoverActions<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fH", ":RustHoverRange<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fm", ":RustExpandMacro<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fc", ":RustOpenCargo<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fk", ":RustMoveItemUp<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fj", ":RustMoveItemDown<CR>", {
|
||||
buffer = true,
|
||||
})
|
1
dots/.config/nvim/after/ftplugin/sh.lua
Normal file
1
dots/.config/nvim/after/ftplugin/sh.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.opt_local.expandtab = false
|
13
dots/.config/nvim/after/ftplugin/sql.lua
Normal file
13
dots/.config/nvim/after/ftplugin/sql.lua
Normal file
@ -0,0 +1,13 @@
|
||||
vim.keymap.set("n", "<leader>fe", "<Plug>(sqls-execute-query)", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("v", "<leader>fe", "<Plug>(sqls-execute-query)", {
|
||||
buffer = true,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fsd", ":SqlsSwitchDatabase<CR>", {
|
||||
buffer = true,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>fsc", ":SqlsSwitchConnection<CR>", {
|
||||
buffer = true,
|
||||
})
|
4
dots/.config/nvim/after/ftplugin/terraform.lua
Normal file
4
dots/.config/nvim/after/ftplugin/terraform.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
3
dots/.config/nvim/after/ftplugin/tex.lua
Normal file
3
dots/.config/nvim/after/ftplugin/tex.lua
Normal file
@ -0,0 +1,3 @@
|
||||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.tabstop = 2
|
||||
vim.opt_local.shiftwidth = 2
|
4
dots/.config/nvim/after/ftplugin/xml.lua
Normal file
4
dots/.config/nvim/after/ftplugin/xml.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
4
dots/.config/nvim/after/ftplugin/yaml.lua
Normal file
4
dots/.config/nvim/after/ftplugin/yaml.lua
Normal file
@ -0,0 +1,4 @@
|
||||
local opt_local = vim.opt_local
|
||||
|
||||
opt_local.tabstop = 2
|
||||
opt_local.shiftwidth = 2
|
3
dots/.config/nvim/after/ftplugin/zsh.lua
Normal file
3
dots/.config/nvim/after/ftplugin/zsh.lua
Normal file
@ -0,0 +1,3 @@
|
||||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.expandtab = false
|
||||
vim.opt_local.tabstop = 4
|
2
dots/.config/nvim/ftdetect/cf3.vim
Normal file
2
dots/.config/nvim/ftdetect/cf3.vim
Normal file
@ -0,0 +1,2 @@
|
||||
au BufRead,BufNewFile *.cf set ft=cf3
|
||||
|
221
dots/.config/nvim/ftplugin/cf3.vim
Normal file
221
dots/.config/nvim/ftplugin/cf3.vim
Normal file
@ -0,0 +1,221 @@
|
||||
" Vim file plugin
|
||||
" This is my first attempt at a ftplugin file. Feel free to send me
|
||||
" corrections or improvements. I'll give you a credit.
|
||||
"
|
||||
" USAGE
|
||||
" There is already a vim file that uses 'cf' as a file extension. You can use
|
||||
" cf3 for your cf3 file extensions or identify via your vimrc file:
|
||||
" au BufRead,BufNewFile *.cf set ft=cf3
|
||||
|
||||
" Check to see if DisableCF3Ftplugin is defined
|
||||
" If you only want the syntax plugin add "let g:DisableCF3Ftplugin=1" in
|
||||
" ~/.vimrc
|
||||
if exists("g:DisableCF3Ftplugin")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:loaded_CFE3Ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:loaded_CFE3Ftplugin = 1
|
||||
|
||||
let s:install_dir = expand('<sfile>:p:h:h')
|
||||
|
||||
" =============== Keyword Abbreviations ===============
|
||||
" enable keyword abbreviations with by adding
|
||||
" "let g:EnableCFE3KeywordAbbreviations=1" to your vimrc
|
||||
" Convenience function ToggleCFE3KeywordAbbreviations
|
||||
" mapped to ,i by default to toggle abbreviations on or off
|
||||
"
|
||||
function! EnableCFE3KeywordAbbreviations()
|
||||
iab <buffer> = =>
|
||||
iab <buffer> ba bundle agent
|
||||
iab <buffer> bc bundle common
|
||||
iab <buffer> bu bundle
|
||||
iab <buffer> cano canonify( "<C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> cla classes:
|
||||
iab <buffer> comma commands:
|
||||
iab <buffer> comme comment => "<C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> exp expression => <C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> fil files:
|
||||
iab <buffer> han handle => "<C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> ifv ifvarclass => <C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> met methods:
|
||||
iab <buffer> pro processes:
|
||||
iab <buffer> rep reports:
|
||||
iab <buffer> sli slist => {
|
||||
iab <buffer> str string => "<C-R>=Eatchar('\s')<CR>
|
||||
iab <buffer> sysw ${sys.workdir}
|
||||
iab <buffer> ub usebundle =>
|
||||
iab <buffer> var vars:
|
||||
endfunction
|
||||
|
||||
function! DisableCFE3KeywordAbbreviations()
|
||||
iunab <buffer> =
|
||||
iunab <buffer> ba
|
||||
iunab <buffer> bc
|
||||
iunab <buffer> bu
|
||||
iunab <buffer> cano
|
||||
iunab <buffer> cla
|
||||
iunab <buffer> comma
|
||||
iunab <buffer> comme
|
||||
iunab <buffer> exp
|
||||
iunab <buffer> fil
|
||||
iunab <buffer> han
|
||||
iunab <buffer> ifv
|
||||
iunab <buffer> met
|
||||
iunab <buffer> pro
|
||||
iunab <buffer> rep
|
||||
iunab <buffer> sli
|
||||
iunab <buffer> str
|
||||
iunab <buffer> sysw
|
||||
iunab <buffer> ub
|
||||
iunab <buffer> var
|
||||
endfunction
|
||||
|
||||
" Default abbreviations off
|
||||
" to disable let g:EnableCFE3KeywordAbbreviations=1 in ~/.vimrc
|
||||
if exists('g:EnableCFE3KeywordAbbreviations')
|
||||
call EnableCFE3KeywordAbbreviations()
|
||||
endif
|
||||
|
||||
function! ToggleCFE3KeywordAbbreviations()
|
||||
if !exists('b:EnableCFE3KeywordAbbreviations')
|
||||
let b:EnableCFE3KeywordAbbreviations=1
|
||||
call EnableCFE3KeywordAbbreviations()
|
||||
else
|
||||
unlet b:EnableCFE3KeywordAbbreviations
|
||||
call DisableCFE3KeywordAbbreviations()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! EnableCFE3PermissionFix()
|
||||
" On Save set the permissions of the edited file so others can't access
|
||||
:autocmd BufWritePost *.cf silent !chmod g-w,o-rwx %
|
||||
endfunction
|
||||
|
||||
" Default permission fix off
|
||||
" To enable permission fixing in your main .vimrc
|
||||
" let g:EnableCFE3PermissionFix=1
|
||||
if exists('g:EnableCFE3PermissionFix')
|
||||
call EnableCFE3PermissionFix()
|
||||
endif
|
||||
|
||||
" maps
|
||||
" Toggle KeywordAbbreviations
|
||||
nnoremap <buffer> ,i :call ToggleCFE3KeywordAbbreviations()<CR>
|
||||
" Wrap WORD in double quotes
|
||||
nnoremap <buffer> ,q dE<ESC>i"<ESC>pa"<ESC>
|
||||
" Insert blank promise
|
||||
nnoremap <buffer> ,p o""<CR><TAB>handle => "",<CR>comment => ""<ESC>
|
||||
" quote list items
|
||||
vnoremap <buffer> ,q :s/^\s*\(.*\)\s*$/"\1",/g<CR>
|
||||
|
||||
" Function to align groups of => assignment lines.
|
||||
" Credit to 'Scripting the Vim editor, Part 2: User-defined functions'
|
||||
" by Damian Conway
|
||||
" http://www.ibm.com/developerworks/linux/library/l-vim-script-2/index.html
|
||||
if !exists("*CF3AlignAssignments")
|
||||
function CF3AlignAssignments (AOP)
|
||||
"Patterns needed to locate assignment operators...
|
||||
if a:AOP == 'vars'
|
||||
let ASSIGN_OP = '\(string\|int\|real\|data\|slist\|ilist\|rlist\|expression\|and\|or\|not\|volume\)*\s\+=>'
|
||||
else
|
||||
let ASSIGN_OP = '=>'
|
||||
endif
|
||||
let ASSIGN_LINE = '^\(.\{-}\)\s*\(' . ASSIGN_OP . '\)'
|
||||
|
||||
"Locate block of code to be considered (same indentation, no blanks)
|
||||
let indent_pat = '^' . matchstr(getline('.'), '^\s*') . '\S'
|
||||
let firstline = search('^\%('. indent_pat . '\)\@!','bnW') + 1
|
||||
let lastline = search('^\%('. indent_pat . '\)\@!', 'nW') - 1
|
||||
if lastline < 0
|
||||
let lastline = line('$')
|
||||
endif
|
||||
|
||||
"Find the column at which the operators should be aligned...
|
||||
let max_align_col = 0
|
||||
let max_op_width = 0
|
||||
for linetext in getline(firstline, lastline)
|
||||
"Does this line have an assignment in it?
|
||||
let left_width = match(linetext, '\s*' . ASSIGN_OP)
|
||||
|
||||
"If so, track the maximal assignment column and operator width...
|
||||
if left_width >= 0
|
||||
let max_align_col = max([max_align_col, left_width])
|
||||
|
||||
let op_width = strlen(matchstr(linetext, ASSIGN_OP))
|
||||
let max_op_width = max([max_op_width, op_width+1])
|
||||
endif
|
||||
endfor
|
||||
|
||||
"Code needed to reformat lines so as to align operators...
|
||||
let FORMATTER = '\=printf("%-*s%*s", max_align_col, submatch(1),
|
||||
\ max_op_width, submatch(2))'
|
||||
|
||||
" Reformat lines with operators aligned in the appropriate column...
|
||||
for linenum in range(firstline, lastline)
|
||||
let oldline = getline(linenum)
|
||||
let newline = substitute(oldline, ASSIGN_LINE, FORMATTER, "")
|
||||
call setline(linenum, newline)
|
||||
endfor
|
||||
endfunction
|
||||
endif
|
||||
|
||||
nnoremap <buffer> <silent> ,= :call CF3AlignAssignments("null")<CR>
|
||||
nnoremap <buffer> <silent> <ESC>= :call CF3AlignAssignments("vars")<CR>
|
||||
|
||||
" For pasting code snippets
|
||||
function! Pastefile( FILE )
|
||||
let arg_file = s:install_dir."/snippets/".a:FILE
|
||||
let @" = join( readfile( arg_file ), "\n" )
|
||||
put
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
nnoremap <buffer> ,k :call Pastefile("template.cf")<CR>kdd
|
||||
nnoremap <buffer> ,s :call Pastefile("stdlib.cf")<CR>kdd
|
||||
|
||||
" TODO
|
||||
" Indents
|
||||
|
||||
" CREDITS
|
||||
" Neil Watson <neil@watson-wilson.ca>
|
||||
" Other Cfengine information: http://watson-wilson.ca/cfengine/
|
||||
"
|
||||
" CHANGES
|
||||
" Wednesday January 09 2013
|
||||
" Operator alignment now works for just '=>' with ',=' or 'string, stlist ,etc
|
||||
" and => ' with '<ESC>='
|
||||
"
|
||||
" Wednesday October 05 2011
|
||||
" - Added comment and handle abbs. Assumes you have the Eatchar and Getchar
|
||||
" functions.
|
||||
" - Can now wrap words and lists in quotes.
|
||||
" - Insert blank promises (,p)
|
||||
" - Insert blank testing skeleton (,k)
|
||||
"
|
||||
" CHANGES
|
||||
" Monday November 21 2011
|
||||
" - IAB's for string, slist and usebundle.
|
||||
|
||||
" CHANGES
|
||||
" Fri Apr 27 2012
|
||||
" Added function to align assigment operators
|
||||
|
||||
" vim_cf3 files (https://github.com/neilhwatson/vim_cf3)
|
||||
" Copyright (C) 2011 Neil H. Watson <neil@watson-wilson.ca>
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify it under
|
||||
" the terms of the GNU General Public License as published by the Free Software
|
||||
" Foundation, either version 3 of the License, or (at your option) any later
|
||||
" version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
" PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License along with
|
||||
" this program. If not, see <http://www.gnu.org/licenses/>.
|
17
dots/.config/nvim/lua/core/autocmds.lua
Normal file
17
dots/.config/nvim/lua/core/autocmds.lua
Normal file
@ -0,0 +1,17 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
-- NOTE: Highlight text yanked
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- NOTE: Remove trailing whitespace on save
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
command = "%s/\\s\\+$//e",
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
25
dots/.config/nvim/lua/core/disabled.lua
Executable file
25
dots/.config/nvim/lua/core/disabled.lua
Executable file
@ -0,0 +1,25 @@
|
||||
local M = {}
|
||||
M.setup = function()
|
||||
local disabled_built_ins = {
|
||||
"gzip",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"2html_plugin",
|
||||
"logipat",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"matchit",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
vim.g["loaded_" .. plugin] = 1
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
12
dots/.config/nvim/lua/core/filetypes.lua
Normal file
12
dots/.config/nvim/lua/core/filetypes.lua
Normal file
@ -0,0 +1,12 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
[".*%.dockerfile"] = "dockerfile",
|
||||
[".*%.dockerignore"] = "gitignore",
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
8
dots/.config/nvim/lua/core/globals.lua
Executable file
8
dots/.config/nvim/lua/core/globals.lua
Executable file
@ -0,0 +1,8 @@
|
||||
local g = vim.g
|
||||
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
end
|
||||
|
||||
return M
|
8
dots/.config/nvim/lua/core/init.lua
Executable file
8
dots/.config/nvim/lua/core/init.lua
Executable file
@ -0,0 +1,8 @@
|
||||
require("core.disabled").setup()
|
||||
require("core.options").setup()
|
||||
require("core.mappings").setup()
|
||||
require("core.globals").setup()
|
||||
require("core.autocmds").setup()
|
||||
require("core.filetypes").setup()
|
||||
require("core.lsp").setup()
|
||||
-- require('core.winbar').setup()
|
54
dots/.config/nvim/lua/core/lsp.lua
Normal file
54
dots/.config/nvim/lua/core/lsp.lua
Normal file
@ -0,0 +1,54 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
local function lspSymbol(name, icon, priority)
|
||||
local hl = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(hl, { text = icon, numhl = hl, texthl = hl, priority = priority })
|
||||
end
|
||||
|
||||
lspSymbol("Error", "", 20)
|
||||
lspSymbol("Warn", "", 15)
|
||||
lspSymbol("Info", "", 10)
|
||||
lspSymbol("Hint", "", 10)
|
||||
|
||||
|
||||
local border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
}
|
||||
|
||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or border
|
||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
severity_sort = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
float = {
|
||||
focusable = true,
|
||||
style = "minimal",
|
||||
border = {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
},
|
||||
source = "always",
|
||||
header = "Diagnostic",
|
||||
prefix = "",
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
66
dots/.config/nvim/lua/core/mappings.lua
Executable file
66
dots/.config/nvim/lua/core/mappings.lua
Executable file
@ -0,0 +1,66 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
-- set mapleader to space
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Get rid of highlight after search
|
||||
vim.keymap.set("n", "<esc>", function()
|
||||
vim.cmd.noh()
|
||||
end, { silent = true, desc = "Remove Highlighted Searches" })
|
||||
|
||||
-- Spell Checking
|
||||
vim.keymap.set("n", "<leader>st", function()
|
||||
vim.opt.spell = not vim.opt.spell:get()
|
||||
end, { silent = true, desc = "Toggle Spell" })
|
||||
|
||||
-- Better split movement
|
||||
vim.keymap.set("n", "<C-l>", "<C-w>l", { silent = true })
|
||||
vim.keymap.set("n", "<C-h>", "<C-w>h", { silent = true })
|
||||
vim.keymap.set("n", "<C-k>", "<C-w>k", { silent = true })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w>j", { silent = true })
|
||||
|
||||
-- Set current focused file as cwd
|
||||
vim.keymap.set("n", "<leader>cd", ":cd %:p:h<CR>", { silent = true, desc = "Change CWD to Current File" })
|
||||
|
||||
-- Toggle showing diagnostics
|
||||
local diagnostics_active = true
|
||||
vim.keymap.set("n", "<leader>lh", function()
|
||||
diagnostics_active = not diagnostics_active
|
||||
if diagnostics_active then
|
||||
vim.diagnostic.enable()
|
||||
else
|
||||
vim.diagnostic.disable()
|
||||
end
|
||||
end, { silent = true, desc = "Toggle Diagnostics" })
|
||||
|
||||
-- Toggle showing command bar
|
||||
vim.keymap.set("n", "<leader>sc", function()
|
||||
local current_cmdheight = vim.opt.cmdheight:get()
|
||||
if current_cmdheight > 0 then
|
||||
vim.opt.cmdheight = 0
|
||||
else
|
||||
vim.opt.cmdheight = 1
|
||||
end
|
||||
end, { silent = true, desc = "Toggle Cmdline" })
|
||||
|
||||
-- Toggle relativenumber
|
||||
vim.keymap.set("n", "<leader>sn", function()
|
||||
vim.opt.relativenumber = not vim.opt.relativenumber:get()
|
||||
end, { silent = true, desc = "Toggle Relativenumber" })
|
||||
|
||||
-- Sudo Write
|
||||
vim.keymap.set("c", "w!!", "w !sudo tee > /dev/null %", { silent = true, desc = "Write as Sudo" })
|
||||
|
||||
-- Terminal mappings
|
||||
vim.keymap.set("t", [[<C-\>]], [[<C-\><C-n>]], { silent = true })
|
||||
|
||||
-- Alternative bindings for increment & decrement
|
||||
vim.keymap.set("n", "+", "<C-a>", { silent = true, remap = true, desc = "Increment" })
|
||||
vim.keymap.set("n", "-", "<C-x>", { silent = true, remap = true, desc = "Decrement" })
|
||||
|
||||
-- Tabclose binding
|
||||
vim.keymap.set("n", "<C-w>t", "<cmd>tabclose<CR>", { silent = true, desc = "Close Tab" })
|
||||
end
|
||||
|
||||
return M
|
134
dots/.config/nvim/lua/core/options.lua
Executable file
134
dots/.config/nvim/lua/core/options.lua
Executable file
@ -0,0 +1,134 @@
|
||||
local opt = vim.opt
|
||||
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
-- Number settings
|
||||
opt.number = true
|
||||
opt.numberwidth = 2
|
||||
opt.relativenumber = true
|
||||
|
||||
-- Scroll Offset
|
||||
opt.scrolloff = 3
|
||||
|
||||
-- Disable showmode
|
||||
opt.showmode = false
|
||||
|
||||
-- Set truecolor support
|
||||
opt.termguicolors = true
|
||||
|
||||
-- Enable system clipboard
|
||||
opt.clipboard = "unnamedplus"
|
||||
|
||||
-- Set mouse support for any mode
|
||||
opt.mouse = "a"
|
||||
|
||||
-- Allow hidden
|
||||
opt.hidden = true
|
||||
|
||||
-- Useful defaults for tab, indentation, etc.
|
||||
opt.tabstop = 4
|
||||
opt.shiftwidth = 4
|
||||
opt.smartindent = true
|
||||
opt.breakindent = true
|
||||
opt.expandtab = true
|
||||
opt.smarttab = true
|
||||
opt.shiftround = true
|
||||
|
||||
-- Search settings
|
||||
opt.hlsearch = true
|
||||
opt.incsearch = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- Better backspaces
|
||||
opt.backspace = "indent,eol,start"
|
||||
|
||||
-- Make new splits vertical
|
||||
opt.splitright = true
|
||||
|
||||
-- Show line & column num of cursor
|
||||
opt.ruler = true
|
||||
|
||||
-- Set timeouts
|
||||
opt.ttimeoutlen = 20
|
||||
opt.timeoutlen = 1000
|
||||
opt.updatetime = 250
|
||||
opt.signcolumn = "yes"
|
||||
|
||||
-- Enable persistent undo
|
||||
opt.undodir = vim.fn.stdpath("cache") .. "/undo"
|
||||
opt.undofile = true
|
||||
|
||||
-- Better folding
|
||||
opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
opt.foldmethod = "expr"
|
||||
opt.fillchars = { eob = " ", fold = " ", foldopen = "", foldsep = " ", foldclose = "" }
|
||||
opt.foldlevel = 20
|
||||
vim.wo.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.wo.foldmethod = "expr"
|
||||
|
||||
-- Concealment for nicer rendering
|
||||
opt.conceallevel = 2
|
||||
opt.concealcursor = "ic"
|
||||
|
||||
-- Cursor line highlight
|
||||
opt.cursorline = true
|
||||
|
||||
-- Disable lazy redraw to interact with plugins better
|
||||
opt.lazyredraw = false
|
||||
|
||||
-- Spell Settings
|
||||
opt.spelllang = { "en_us" }
|
||||
|
||||
-- Better completion experience
|
||||
opt.completeopt = "menuone,noselect"
|
||||
|
||||
-- Set max text width
|
||||
opt.textwidth = 120
|
||||
|
||||
-- Make statusline global
|
||||
opt.laststatus = 3
|
||||
|
||||
-- Set listcharacters
|
||||
opt.list = true
|
||||
opt.listchars:append("tab:-->")
|
||||
opt.listchars:append("lead:⋅")
|
||||
opt.listchars:append("trail:·")
|
||||
opt.listchars:append("extends:◣")
|
||||
opt.listchars:append("precedes:◢")
|
||||
opt.listchars:append("nbsp:○")
|
||||
|
||||
-- Set fillchars
|
||||
vim.opt.fillchars:append({
|
||||
horiz = "━",
|
||||
horizup = "┻",
|
||||
horizdown = "┳",
|
||||
vert = "┃",
|
||||
vertleft = "┨",
|
||||
vertright = "┣",
|
||||
verthoriz = "╋",
|
||||
})
|
||||
|
||||
-- Remove end of boundry '~'
|
||||
opt.fillchars:append("eob: ")
|
||||
|
||||
-- Allow vim to get settings from file
|
||||
opt.modeline = true
|
||||
opt.modelines = 5
|
||||
|
||||
-- Set command bar height
|
||||
opt.cmdheight = 1
|
||||
|
||||
-- Set splitkeep
|
||||
vim.opt.splitkeep = "screen"
|
||||
|
||||
-- Hide the tabline
|
||||
vim.opt.showtabline = 0
|
||||
|
||||
-- Improved diff
|
||||
opt.diffopt:append("linematch:75")
|
||||
opt.fillchars:append("diff:╱")
|
||||
end
|
||||
|
||||
return M
|
0
dots/.config/nvim/lua/core/postload.lua
Executable file
0
dots/.config/nvim/lua/core/postload.lua
Executable file
27
dots/.config/nvim/lua/core/winbar.lua
Normal file
27
dots/.config/nvim/lua/core/winbar.lua
Normal file
@ -0,0 +1,27 @@
|
||||
local M = {}
|
||||
|
||||
M.winbar = function()
|
||||
local win_number = "[" .. vim.api.nvim_win_get_number(0) .. "]"
|
||||
local ignore_fts = {
|
||||
"neo-tree",
|
||||
"dashboard",
|
||||
"alpha",
|
||||
}
|
||||
|
||||
for _, ft in ipairs(ignore_fts) do
|
||||
if ft == vim.bo.filetype then
|
||||
return win_number .. " " .. ft
|
||||
end
|
||||
end
|
||||
|
||||
local relative_path = vim.fn.fnamemodify(vim.fn.expand("%:h"), ":p:~:.")
|
||||
local filename = vim.fn.expand("%:t")
|
||||
return win_number .. " " .. relative_path .. filename
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
-- Winbar
|
||||
vim.opt.winbar = "%{%v:lua.require('core.winbar').winbar()%}"
|
||||
end
|
||||
|
||||
return M
|
16
dots/.config/nvim/lua/main.lua
Executable file
16
dots/.config/nvim/lua/main.lua
Executable file
@ -0,0 +1,16 @@
|
||||
-- INFO: Primary loading, where most things are loaded in
|
||||
--
|
||||
-- INFO: All modules/dirs that are going to be loaded
|
||||
-- INFO: SHOULD have a init.lua file associated with them.
|
||||
-- INFO: init.lua is responsible for loading all configuration
|
||||
-- INFO: related to that directory.
|
||||
require("core.init")
|
||||
require("plugins.init")
|
||||
|
||||
-- INFO: Post load, for things that need to setup keybindings etc after the fact
|
||||
--
|
||||
-- NOTE: All postload modules should be independent of each other, they shouldn't
|
||||
-- NOTE: rely on each other's load order. That type of logic should be shifted
|
||||
-- NOTE: into non-postload regions then handled in postload modules.
|
||||
require("plugins.postload")
|
||||
require("core.postload")
|
0
dots/.config/nvim/lua/plugins/autocmds.lua
Executable file
0
dots/.config/nvim/lua/plugins/autocmds.lua
Executable file
203
dots/.config/nvim/lua/plugins/configs/_cmp.lua
Executable file
203
dots/.config/nvim/lua/plugins/configs/_cmp.lua
Executable file
@ -0,0 +1,203 @@
|
||||
local cmp = require("cmp")
|
||||
local types = require("cmp.types")
|
||||
local str = require("cmp.utils.str")
|
||||
local compare = cmp.config.compare
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
-- Load Snippets
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
|
||||
fields = { cmp.ItemField.Kind, cmp.ItemField.Abbr, cmp.ItemField.Menu },
|
||||
format = function(entry, vim_item)
|
||||
local selections = {
|
||||
fuzzy_buffer = { symbol = " ", name = "Buffer", hl_group = "Buffer" },
|
||||
path = { symbol = " ", name = "Path", hl_group = "Path" },
|
||||
calc = { symbol = " ", name = "Calculator", hl_group = "Calculator" },
|
||||
neorg = { symbol = " ", name = "Neorg", hl_group = "Neorg" },
|
||||
emoji = { symbol = "ﲃ ", name = "Emoji", hl_group = "Emoji" },
|
||||
zsh = { symbol = " ", name = "Zsh", hl_group = "Zsh" },
|
||||
crates = { symbol = " ", name = "Crates", hl_group = "Crates" },
|
||||
cmdline_history = { symbol = " ", name = "Cmd History", hl_group = "CmdHistory" },
|
||||
rg = { symbol = " ", name = "Ripgrep", hl_group = "Ripgrep" },
|
||||
npm = { symbol = " ", name = "Npm,", hl_group = "Npm," },
|
||||
conventionalcommits = { symbol = " ", name = "Commit", hl_group = "Commit" },
|
||||
spell = { symbol = " ", name = "Spell", hl_group = "Spell" },
|
||||
}
|
||||
|
||||
local extra_kind_icons = {
|
||||
TypeParameter = "",
|
||||
}
|
||||
|
||||
local selection = selections[entry.source.name]
|
||||
if not selection then
|
||||
local kind = require("lspkind").cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 50,
|
||||
})(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
if not strings[2] then
|
||||
strings[2] = strings[1]
|
||||
strings[1] = extra_kind_icons[strings[1]] or ""
|
||||
end
|
||||
kind.kind = " " .. strings[1] .. " "
|
||||
vim_item.menu = (strings[1] or "") .. " " .. (strings[2] or "")
|
||||
return kind
|
||||
else
|
||||
local word = entry:get_insert_text()
|
||||
if entry.completion_item.insertTextFormat == types.lsp.InsertTextFormat.Snippet then
|
||||
word = vim.lsp.util.parse_snippet(word)
|
||||
end
|
||||
word = str.oneline(word)
|
||||
|
||||
-- concatenates the string
|
||||
local max = 50
|
||||
if string.len(word) >= max then
|
||||
local before = string.sub(word, 1, math.floor((max - 3) / 2))
|
||||
word = before .. "..."
|
||||
end
|
||||
vim_item.kind = " " .. selection.symbol
|
||||
vim_item.menu = selection.symbol .. selection.name
|
||||
vim_item.kind_hl_group = "CmpCustomSelection" .. selection.hl_group
|
||||
vim_item.abbr = word
|
||||
return vim_item
|
||||
end
|
||||
end,
|
||||
},
|
||||
view = {
|
||||
entries = {
|
||||
name = "custom",
|
||||
selection_order = "near_cursor",
|
||||
},
|
||||
},
|
||||
window = {
|
||||
documentation = {
|
||||
side_padding = 0,
|
||||
},
|
||||
completion = {
|
||||
winhighlight = "Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None",
|
||||
col_offset = -3,
|
||||
side_padding = 0,
|
||||
},
|
||||
},
|
||||
experimental = { ghost_text = true, native_menu = false },
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
["<C-b>"] = cmp.mapping(cmp.mapping.scroll_docs(-4), { "i", "c" }),
|
||||
["<C-f>"] = cmp.mapping(cmp.mapping.scroll_docs(4), { "i", "c" }),
|
||||
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
|
||||
["<C-y>"] = cmp.config.disable, -- Specify `cmp.config.disable` if you want to remove the default `<C-y>` mapping.
|
||||
["<C-e>"] = cmp.mapping({
|
||||
i = cmp.mapping.abort(),
|
||||
c = cmp.mapping.close(),
|
||||
}),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-Tab>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<C-S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp", priority = 11 },
|
||||
{ name = "luasnip", priority = 10 }, -- For luasnip users.
|
||||
{ name = "fuzzy_buffer", priority = 9, keyword_length = 3, max_item_count = 10 },
|
||||
{
|
||||
name = "rg",
|
||||
priority = 7,
|
||||
keyword_length = 3,
|
||||
max_item_count = 10,
|
||||
},
|
||||
{ name = "path", priority = 6 },
|
||||
{ name = "zsh", priority = 5 },
|
||||
{ name = "emoji", keyword_length = 2 },
|
||||
{ name = "neorg" },
|
||||
{ name = "calc" },
|
||||
{ name = "npm", keyword_length = 2 },
|
||||
{ name = "spell", keyword_length = 2 },
|
||||
}),
|
||||
sorting = {
|
||||
comparators = {
|
||||
compare.score,
|
||||
compare.offset,
|
||||
compare.recently_used,
|
||||
compare.exact,
|
||||
require("cmp_fuzzy_buffer.compare"),
|
||||
compare.kind,
|
||||
compare.sort_text,
|
||||
compare.length,
|
||||
compare.order,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Git Commit Completions
|
||||
cmp.setup.filetype("gitcommit", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = "conventionalcommits", priority = 20 },
|
||||
{ name = "emoji", keyword_length = 2 },
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.setup.filetype("toml", { sources = cmp.config.sources({ { name = "crates" } }) })
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({ { name = "fuzzy_buffer" } }),
|
||||
})
|
||||
|
||||
cmp.setup.cmdline("?", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({ { name = "fuzzy_buffer" } }),
|
||||
})
|
||||
|
||||
cmp.setup.cmdline("@", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "fuzzy_buffer" },
|
||||
{ name = "cmdline_history" },
|
||||
}),
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
{ name = "cmdline" },
|
||||
{ name = "cmdline_history" },
|
||||
}),
|
||||
})
|
137
dots/.config/nvim/lua/plugins/configs/_dap.lua
Executable file
137
dots/.config/nvim/lua/plugins/configs/_dap.lua
Executable file
@ -0,0 +1,137 @@
|
||||
local dap = require("dap")
|
||||
local async = require("plenary.async")
|
||||
|
||||
--- Gets a path for a given program in the environment
|
||||
---@param program @The string of a program in the PATH
|
||||
---@return @The full path to the program if found, or nil if not
|
||||
local function get_program_path(program)
|
||||
local program_path = vim.fn.stdpath("data") .. "/mason/packages/" .. program .. "/" .. program
|
||||
return program_path
|
||||
end
|
||||
|
||||
local lldb_path = get_program_path("codelldb")
|
||||
-- Adapaters
|
||||
dap.adapters.lldb = {
|
||||
type = "executable",
|
||||
command = lldb_path,
|
||||
name = "lldb",
|
||||
}
|
||||
|
||||
dap.adapters.coreclr = {
|
||||
type = "executable",
|
||||
command = get_program_path("netcoredbg"),
|
||||
args = { "--interpreter=vscode" },
|
||||
}
|
||||
|
||||
dap.adapters.bashdb = {
|
||||
type = "executable",
|
||||
command = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/bash-debug-adapter",
|
||||
name = "bashdb",
|
||||
}
|
||||
|
||||
-- configurations
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "lldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false,
|
||||
targetArchitecture = "arm64",
|
||||
args = {},
|
||||
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.c = dap.configurations.cpp
|
||||
dap.configurations.rust = dap.configurations.cpp
|
||||
|
||||
vim.g.dotnet_build_project = function()
|
||||
local default_path = vim.fn.getcwd() .. "/"
|
||||
if vim.g["dotnet_last_proj_path"] ~= nil then
|
||||
default_path = vim.g["dotnet_last_proj_path"]
|
||||
end
|
||||
local path = vim.fn.input("Path to your *proj file", default_path, "file")
|
||||
vim.g["dotnet_last_proj_path"] = path
|
||||
local cmd = "dotnet build -c Debug " .. path .. " > /dev/null"
|
||||
print("")
|
||||
print("Cmd to execute: " .. cmd)
|
||||
local f = os.execute(cmd)
|
||||
if f == 0 then
|
||||
print("\nBuild: ✔️ ")
|
||||
else
|
||||
print("\nBuild: ❌ (code: " .. f .. ")")
|
||||
end
|
||||
end
|
||||
|
||||
vim.g.dotnet_get_dll_path = function()
|
||||
local request = function()
|
||||
return vim.fn.input("Path to dll", vim.fn.getcwd() .. "/bin/Debug/", "file")
|
||||
end
|
||||
|
||||
if vim.g["dotnet_last_dll_path"] == nil then
|
||||
vim.g["dotnet_last_dll_path"] = request()
|
||||
else
|
||||
if
|
||||
vim.fn.confirm("Do you want to change the path to dll?\n" .. vim.g["dotnet_last_dll_path"], "&yes\n&no", 2)
|
||||
== 1
|
||||
then
|
||||
vim.g["dotnet_last_dll_path"] = request()
|
||||
end
|
||||
end
|
||||
|
||||
return vim.g["dotnet_last_dll_path"]
|
||||
end
|
||||
|
||||
local config = {
|
||||
{
|
||||
type = "coreclr",
|
||||
name = "launch - netcoredbg",
|
||||
request = "launch",
|
||||
program = function()
|
||||
if vim.fn.confirm("Should I recompile first?", "&yes\n&no", 2) == 1 then
|
||||
vim.g.dotnet_build_project()
|
||||
end
|
||||
return vim.g.dotnet_get_dll_path()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.cs = config
|
||||
dap.configurations.fsharp = config
|
||||
|
||||
dap.configurations.sh = {
|
||||
{
|
||||
type = "bashdb",
|
||||
request = "launch",
|
||||
name = "Launch file",
|
||||
showDebugOutput = true,
|
||||
pathBashdb = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb",
|
||||
pathBashdbLib = vim.fn.stdpath("data") .. "/mason/packages/bash-debug-adapter/extension/bashdb_dir",
|
||||
trace = true,
|
||||
file = "${file}",
|
||||
program = "${file}",
|
||||
cwd = "${workspaceFolder}",
|
||||
pathCat = "cat",
|
||||
pathBash = "/bin/bash",
|
||||
pathMkfifo = "mkfifo",
|
||||
pathPkill = "pkill",
|
||||
args = {},
|
||||
env = {},
|
||||
terminalKind = "integrated",
|
||||
},
|
||||
}
|
48
dots/.config/nvim/lua/plugins/configs/_neorg.lua
Executable file
48
dots/.config/nvim/lua/plugins/configs/_neorg.lua
Executable file
@ -0,0 +1,48 @@
|
||||
local neorg = require("neorg")
|
||||
|
||||
neorg.setup({
|
||||
load = {
|
||||
["core.defaults"] = {},
|
||||
["core.norg.concealer"] = {
|
||||
config = {
|
||||
dim_code_blocks = {
|
||||
enabled = true,
|
||||
content_only = true,
|
||||
adaptive = true,
|
||||
},
|
||||
icon_preset = "diamond",
|
||||
},
|
||||
},
|
||||
["core.norg.esupports.metagen"] = {
|
||||
config = {
|
||||
type = "auto",
|
||||
},
|
||||
},
|
||||
["core.integrations.nvim-cmp"] = {
|
||||
config = {},
|
||||
},
|
||||
["core.norg.completion"] = {
|
||||
config = {
|
||||
engine = "nvim-cmp",
|
||||
},
|
||||
},
|
||||
["core.keybinds"] = {
|
||||
config = {
|
||||
default_keybinds = true,
|
||||
-- norg_leader = "-"
|
||||
},
|
||||
},
|
||||
["core.norg.dirman"] = {
|
||||
config = {
|
||||
workspaces = {
|
||||
default = "~/.notes", -- Format: <name_of_workspace> = <path_to_workspace_root>
|
||||
},
|
||||
autochdir = true, -- Automatically change the directory to the current workspace's root every time
|
||||
index = "index.norg", -- The name of the main (root) .norg file
|
||||
last_workspace = vim.fn.stdpath("cache") .. "/neorg_last_workspace.txt", -- The location to write and read the workspace cache file
|
||||
},
|
||||
},
|
||||
["core.integrations.telescope"] = {},
|
||||
["core.norg.qol.toc"] = {},
|
||||
},
|
||||
})
|
20
dots/.config/nvim/lua/plugins/configs/_stabilize.lua
Executable file
20
dots/.config/nvim/lua/plugins/configs/_stabilize.lua
Executable file
@ -0,0 +1,20 @@
|
||||
require("stabilize").setup({
|
||||
-- stabilize window even when current cursor position will be hidden behind new window
|
||||
force = true,
|
||||
-- set context mark to register on force event which can be jumped to with '<forcemark>
|
||||
forcemark = nil,
|
||||
-- do not manage windows matching these file/buftypes
|
||||
ignore = {
|
||||
filetype = { "packer", "Dashboard", "Trouble", "TelescopePrompt" },
|
||||
buftype = {
|
||||
"packer",
|
||||
"Dashboard",
|
||||
"terminal",
|
||||
"quickfix",
|
||||
"loclist",
|
||||
"LspInstall",
|
||||
},
|
||||
},
|
||||
-- comma-separated list of autocmds that wil trigger the plugins window restore function
|
||||
nested = nil,
|
||||
})
|
181
dots/.config/nvim/lua/plugins/configs/alpha.lua
Normal file
181
dots/.config/nvim/lua/plugins/configs/alpha.lua
Normal file
@ -0,0 +1,181 @@
|
||||
local alpha = require("alpha")
|
||||
|
||||
-- Set header
|
||||
local header = {
|
||||
type = "text",
|
||||
val = {
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" -╲ '- ",
|
||||
" -' :╲ │ '- ",
|
||||
" -' : ╲ │ '- ",
|
||||
" -'· : ╲ │ '- ",
|
||||
" '.-.· : ╲ │ │ ",
|
||||
" │. .-· : ╲ │ │ ",
|
||||
" │ . .-· : ╲ │ │ ",
|
||||
" │. . .-·; ╲ │ │ ",
|
||||
" │ . . .-│ ╲ │ │ ",
|
||||
" │. . . .│╲ ╲│ │ ",
|
||||
" │ . . . │ ╲ ;- │ ",
|
||||
" │. . . .│ ╲ :·- │ ",
|
||||
" │ . . . │ ╲ : .- │ ",
|
||||
" │. . . .│ ╲ :. .- │ ",
|
||||
" `- . . .│ ╲ : . .- -' ",
|
||||
" `- . .│ ╲ :. ..-' ",
|
||||
" `-. │ ╲ :..-' ",
|
||||
" `│ ╲;-' ",
|
||||
" ",
|
||||
" ",
|
||||
},
|
||||
opts = { position = "center", hl = "@boolean" },
|
||||
}
|
||||
|
||||
local vim_version = {
|
||||
type = "text",
|
||||
val = function ()
|
||||
local version = vim.version()
|
||||
return ('─────── v%s.%s.%s ───────'):format(version.major, version.minor, version.patch)
|
||||
end,
|
||||
opts = { position = "center", hl = "@boolean"}
|
||||
}
|
||||
|
||||
local plugins_loaded = {
|
||||
type = "text",
|
||||
val = function()
|
||||
local lazy_stats = require("lazy").stats()
|
||||
local plugin_count = lazy_stats.count
|
||||
local loaded_plugins = lazy_stats.loaded
|
||||
return "" .. loaded_plugins .. "/" .. plugin_count .. " plugins loaded!"
|
||||
end,
|
||||
|
||||
opts = { hl = "@conditional", position = "center" },
|
||||
}
|
||||
|
||||
vim.api.nvim_set_hl(0, "AlphaPluginUpdate", { link = "@string" })
|
||||
local plugin_info = {
|
||||
type = "text",
|
||||
val = function()
|
||||
if require("lazy.status").has_updates() then
|
||||
vim.api.nvim_set_hl(0, "AlphaPluginUpdate", { link = "@exception" })
|
||||
return "Plugin updates available!"
|
||||
else
|
||||
vim.api.nvim_set_hl(0, "AlphaPluginUpdate", { link = "@string" })
|
||||
return "All plugins up to date"
|
||||
end
|
||||
end,
|
||||
|
||||
opts = {
|
||||
hl = "AlphaPluginUpdate",
|
||||
position = "center",
|
||||
},
|
||||
}
|
||||
|
||||
local datetime = {
|
||||
type = "text",
|
||||
val = function()
|
||||
return vim.fn.strftime("%c")
|
||||
end,
|
||||
opts = { hl = "@field", position = "center" },
|
||||
}
|
||||
|
||||
-- Menu
|
||||
local button = function(sc, txt, keybind)
|
||||
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
|
||||
|
||||
local opts = {
|
||||
position = "center",
|
||||
text = txt,
|
||||
shortcut = sc,
|
||||
cursor = 4,
|
||||
width = 30,
|
||||
align_shortcut = "right",
|
||||
hl_shortcut = "Number",
|
||||
hl = "Function",
|
||||
}
|
||||
if keybind then
|
||||
opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } }
|
||||
end
|
||||
|
||||
return {
|
||||
type = "button",
|
||||
val = txt,
|
||||
on_press = function()
|
||||
local key = vim.api.nvim_replace_termcodes(sc_, true, false, true)
|
||||
vim.api.nvim_feedkeys(key, "normal", false)
|
||||
end,
|
||||
opts = opts,
|
||||
}
|
||||
end
|
||||
|
||||
-- Set menu
|
||||
local buttons = {
|
||||
type = "group",
|
||||
val = {
|
||||
button("e", " New File", ":ene <BAR> startinsert <CR>"),
|
||||
button("f", " Find File", ":Telescope find_files<CR>"),
|
||||
button("r", " Recent", ":Telescope oldfiles<CR>"),
|
||||
button("s", " Settings", "<cmd>e ~/.config/nvim/<CR>"),
|
||||
button("u", " Update Plugins", ":Lazy sync<CR>"),
|
||||
button("q", " Quit", ":qa<CR>"),
|
||||
},
|
||||
opts = { spacing = 0 },
|
||||
}
|
||||
|
||||
-- Footer 2, fortune
|
||||
local fortune = {
|
||||
type = "text",
|
||||
val = require("alpha.fortune")(),
|
||||
opts = { position = "center", hl = "Comment" },
|
||||
}
|
||||
|
||||
local padding = function(pad_amount)
|
||||
return { type = "padding", val = pad_amount }
|
||||
end
|
||||
local opts = {
|
||||
layout = {
|
||||
padding(4),
|
||||
header,
|
||||
vim_version,
|
||||
padding(4),
|
||||
datetime,
|
||||
padding(1),
|
||||
plugin_info,
|
||||
padding(1),
|
||||
plugins_loaded,
|
||||
padding(4),
|
||||
buttons,
|
||||
padding(4),
|
||||
fortune,
|
||||
},
|
||||
opts = { margin = 5 },
|
||||
}
|
||||
-- Send config to alpha
|
||||
alpha.setup(opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "alpha",
|
||||
desc = "Alpha Main Handler",
|
||||
callback = function()
|
||||
vim.opt_local.cursorline = false
|
||||
|
||||
local alpha_timer = vim.loop.new_timer()
|
||||
alpha_timer:start(
|
||||
50,
|
||||
1000,
|
||||
vim.schedule_wrap(function()
|
||||
pcall(vim.cmd, "AlphaRedraw")
|
||||
end)
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd("BufUnload", {
|
||||
buffer = 0,
|
||||
desc = "Shut down alpha timer",
|
||||
callback = function(input)
|
||||
alpha_timer:close()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
87
dots/.config/nvim/lua/plugins/configs/ccc.lua
Normal file
87
dots/.config/nvim/lua/plugins/configs/ccc.lua
Normal file
@ -0,0 +1,87 @@
|
||||
local ColorInput = require("ccc.input")
|
||||
local convert = require("ccc.utils.convert")
|
||||
|
||||
local RgbHslCmykInput = setmetatable({
|
||||
name = "RGB/HSL/CMYK",
|
||||
max = { 1, 1, 1, 360, 1, 1, 1, 1, 1, 1 },
|
||||
min = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
delta = { 1 / 255, 1 / 255, 1 / 255, 1, 0.01, 0.01, 0.005, 0.005, 0.005, 0.005 },
|
||||
bar_name = { "R", "G", "B", "H", "S", "L", "C", "M", "Y", "K" },
|
||||
}, { __index = ColorInput })
|
||||
|
||||
function RgbHslCmykInput.format(n, i)
|
||||
if i <= 3 then
|
||||
-- RGB
|
||||
n = n * 255
|
||||
elseif i == 5 or i == 6 then
|
||||
-- S or L of HSL
|
||||
n = n * 100
|
||||
elseif i >= 7 then
|
||||
-- CMYK
|
||||
return ("%5.1f%%"):format(math.floor(n * 200) / 2)
|
||||
end
|
||||
return ("%6d"):format(n)
|
||||
end
|
||||
|
||||
function RgbHslCmykInput.from_rgb(RGB)
|
||||
local HSL = convert.rgb2hsl(RGB)
|
||||
local CMYK = convert.rgb2cmyk(RGB)
|
||||
local R, G, B = unpack(RGB)
|
||||
local H, S, L = unpack(HSL)
|
||||
local C, M, Y, K = unpack(CMYK)
|
||||
return { R, G, B, H, S, L, C, M, Y, K }
|
||||
end
|
||||
|
||||
function RgbHslCmykInput.to_rgb(value)
|
||||
return { value[1], value[2], value[3] }
|
||||
end
|
||||
|
||||
function RgbHslCmykInput:_set_rgb(RGB)
|
||||
self.value[1] = RGB[1]
|
||||
self.value[2] = RGB[2]
|
||||
self.value[3] = RGB[3]
|
||||
end
|
||||
|
||||
function RgbHslCmykInput:_set_hsl(HSL)
|
||||
self.value[4] = HSL[1]
|
||||
self.value[5] = HSL[2]
|
||||
self.value[6] = HSL[3]
|
||||
end
|
||||
|
||||
function RgbHslCmykInput:_set_cmyk(CMYK)
|
||||
self.value[7] = CMYK[1]
|
||||
self.value[8] = CMYK[2]
|
||||
self.value[9] = CMYK[3]
|
||||
self.value[10] = CMYK[4]
|
||||
end
|
||||
|
||||
function RgbHslCmykInput:callback(index, new_value)
|
||||
self.value[index] = new_value
|
||||
local v = self.value
|
||||
if index <= 3 then
|
||||
local RGB = { v[1], v[2], v[3] }
|
||||
local HSL = convert.rgb2hsl(RGB)
|
||||
local CMYK = convert.rgb2cmyk(RGB)
|
||||
self:_set_hsl(HSL)
|
||||
self:_set_cmyk(CMYK)
|
||||
elseif index <= 6 then
|
||||
local HSL = { v[4], v[5], v[6] }
|
||||
local RGB = convert.hsl2rgb(HSL)
|
||||
local CMYK = convert.rgb2cmyk(RGB)
|
||||
self:_set_rgb(RGB)
|
||||
self:_set_cmyk(CMYK)
|
||||
else
|
||||
local CMYK = { v[7], v[8], v[9], v[10] }
|
||||
local RGB = convert.cmyk2rgb(CMYK)
|
||||
local HSL = convert.rgb2hsl(RGB)
|
||||
self:_set_rgb(RGB)
|
||||
self:_set_hsl(HSL)
|
||||
end
|
||||
end
|
||||
|
||||
local ccc = require("ccc")
|
||||
ccc.setup({
|
||||
inputs = {
|
||||
RgbHslCmykInput,
|
||||
},
|
||||
})
|
9
dots/.config/nvim/lua/plugins/configs/dap-ui.lua
Executable file
9
dots/.config/nvim/lua/plugins/configs/dap-ui.lua
Executable file
@ -0,0 +1,9 @@
|
||||
local fn = vim.fn
|
||||
|
||||
require("dapui").setup({})
|
||||
|
||||
fn.sign_define("DapBreakpoint", { text = "● ", texthl = "DiagnosticSignError", linehl = "", numhl = "" })
|
||||
fn.sign_define("DapBreakpointCondition", { text = "● ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" })
|
||||
fn.sign_define("DapLogPoint", { text = "● ", texthl = "DiagnosticSignInfo", linehl = "", numhl = "" })
|
||||
fn.sign_define("DapStopped", { text = "→ ", texthl = "DiagnosticSignWarn", linehl = "", numhl = "" })
|
||||
fn.sign_define("DapBreakpointReject", { text = "●", texthl = "DiagnosticSignHint", linehl = "", numhl = "" })
|
19
dots/.config/nvim/lua/plugins/configs/file-explorer.lua
Executable file
19
dots/.config/nvim/lua/plugins/configs/file-explorer.lua
Executable file
@ -0,0 +1,19 @@
|
||||
local nvim_tree = require("nvim-tree.configs")
|
||||
|
||||
nvim_tree.setup({
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
disable = {
|
||||
-- Ansible support reasons
|
||||
"ansible.yaml",
|
||||
"yaml.ansible",
|
||||
},
|
||||
},
|
||||
matchup = {
|
||||
enable = true,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
282
dots/.config/nvim/lua/plugins/configs/hydra.lua
Normal file
282
dots/.config/nvim/lua/plugins/configs/hydra.lua
Normal file
@ -0,0 +1,282 @@
|
||||
local hydra = require("hydra")
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
h = {
|
||||
name = "Hydra",
|
||||
o = { "Options" },
|
||||
g = { "Git Signs" },
|
||||
d = { "Diagram" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
-- Side Scroll
|
||||
hydra({
|
||||
name = "Side scroll",
|
||||
config = {
|
||||
{
|
||||
position = "bottom-right",
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
mode = "n",
|
||||
body = "z",
|
||||
heads = {
|
||||
{ "h", "5zh" },
|
||||
{ "l", "5zl", { desc = "←/→" } },
|
||||
{ "H", "zH" },
|
||||
{ "L", "zL", { desc = "half screen ←/→" } },
|
||||
},
|
||||
})
|
||||
|
||||
-- Git Integration
|
||||
local gitsigns = require("gitsigns")
|
||||
|
||||
local hint = [[
|
||||
_J_: next hunk _s_: stage hunk _d_: show deleted _b_: blame line
|
||||
_K_: prev hunk _u_: undo stage hunk _p_: preview hunk _B_: blame show full
|
||||
^ ^ _S_: stage buffer ^ ^ _/_: show base file
|
||||
^
|
||||
^ ^ _<Enter>_: Neogit _q_: exit
|
||||
]]
|
||||
|
||||
hydra({
|
||||
hint = hint,
|
||||
config = {
|
||||
color = "pink",
|
||||
invoke_on_body = true,
|
||||
hint = {
|
||||
position = "bottom-right",
|
||||
border = "rounded",
|
||||
},
|
||||
on_enter = function()
|
||||
vim.bo.modifiable = false
|
||||
gitsigns.toggle_signs(true)
|
||||
gitsigns.toggle_linehl(true)
|
||||
end,
|
||||
on_exit = function()
|
||||
gitsigns.toggle_signs(false)
|
||||
gitsigns.toggle_linehl(false)
|
||||
gitsigns.toggle_deleted(false)
|
||||
end,
|
||||
},
|
||||
mode = { "n", "x" },
|
||||
body = "<leader>hg",
|
||||
heads = {
|
||||
{
|
||||
"J",
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
return "]c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gitsigns.next_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end,
|
||||
{ expr = true },
|
||||
},
|
||||
{
|
||||
"K",
|
||||
function()
|
||||
if vim.wo.diff then
|
||||
return "[c"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gitsigns.prev_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end,
|
||||
{ expr = true },
|
||||
},
|
||||
{ "s", ":Gitsigns stage_hunk<CR>", { silent = true } },
|
||||
{ "u", gitsigns.undo_stage_hunk },
|
||||
{ "S", gitsigns.stage_buffer },
|
||||
{ "p", gitsigns.preview_hunk },
|
||||
{ "d", gitsigns.toggle_deleted, { nowait = true } },
|
||||
{ "b", gitsigns.blame_line },
|
||||
{
|
||||
"B",
|
||||
function()
|
||||
gitsigns.blame_line({ full = true })
|
||||
end,
|
||||
},
|
||||
{ "/", gitsigns.show, { exit = true } }, -- show the base of the file
|
||||
{ "<Enter>", "<cmd>Neogit<CR>", { exit = true } },
|
||||
{ "q", nil, { exit = true, nowait = true } },
|
||||
},
|
||||
})
|
||||
|
||||
-- Hydra to repeat expanding windows
|
||||
hydra({
|
||||
name = "Window Sizing",
|
||||
mode = "n",
|
||||
body = "<C-w>",
|
||||
config = {
|
||||
{
|
||||
position = "bottom-right",
|
||||
border = "rounded",
|
||||
},
|
||||
},
|
||||
heads = {
|
||||
{ "<", "2<C-w><" },
|
||||
{ ">", "2<C-w>>", { desc = "←/→" } },
|
||||
{ "+", "2<C-w>+" },
|
||||
{ "-", "2<C-w>-", { desc = "↑/↓" } },
|
||||
},
|
||||
})
|
||||
|
||||
-- Hydra for diagrams
|
||||
|
||||
hydra({
|
||||
name = "Draw Diagram",
|
||||
hint = [[
|
||||
Arrow^^^^^^ Select region with <C-v>
|
||||
^ ^ _K_ ^ ^ _f_: surround it with box
|
||||
_H_ ^ ^ _L_
|
||||
^ ^ _J_ ^ ^ _<Esc>_
|
||||
]],
|
||||
config = {
|
||||
color = "pink",
|
||||
invoke_on_body = true,
|
||||
hint = {
|
||||
border = "rounded",
|
||||
},
|
||||
on_enter = function()
|
||||
vim.o.virtualedit = "all"
|
||||
vim.o.cursorline = true
|
||||
vim.o.cursorcolumn = true
|
||||
end,
|
||||
},
|
||||
mode = "n",
|
||||
body = "<leader>hd",
|
||||
heads = {
|
||||
{ "H", "<C-v>h:VBox<CR>" },
|
||||
{ "J", "<C-v>j:VBox<CR>" },
|
||||
{ "K", "<C-v>k:VBox<CR>" },
|
||||
{ "L", "<C-v>l:VBox<CR>" },
|
||||
{ "f", ":VBox<CR>", { mode = "v" } },
|
||||
{ "<Esc>", nil, { exit = true } },
|
||||
},
|
||||
})
|
||||
|
||||
hydra({
|
||||
name = "Options",
|
||||
hint = [[
|
||||
^ ^ Options
|
||||
^
|
||||
_v_ %{ve} virtual edit
|
||||
_i_ %{list} invisible characters
|
||||
_s_ %{spell} spell
|
||||
_w_ %{wrap} wrap
|
||||
_c_ %{cul} cursor line
|
||||
_n_ %{nu} number
|
||||
_r_ %{rnu} relative number
|
||||
^
|
||||
^^^^ _<Esc>_
|
||||
]],
|
||||
config = {
|
||||
color = "amaranth",
|
||||
invoke_on_body = true,
|
||||
hint = {
|
||||
border = "rounded",
|
||||
position = "middle",
|
||||
},
|
||||
},
|
||||
mode = { "n", "x" },
|
||||
body = "<leader>ho",
|
||||
heads = {
|
||||
{
|
||||
"n",
|
||||
function()
|
||||
if vim.o.number == true then
|
||||
vim.o.number = false
|
||||
else
|
||||
vim.o.number = true
|
||||
end
|
||||
end,
|
||||
{ desc = "number" },
|
||||
},
|
||||
{
|
||||
"r",
|
||||
function()
|
||||
if vim.o.relativenumber == true then
|
||||
vim.o.relativenumber = false
|
||||
else
|
||||
vim.o.number = true
|
||||
vim.o.relativenumber = true
|
||||
end
|
||||
end,
|
||||
{ desc = "relativenumber" },
|
||||
},
|
||||
{
|
||||
"v",
|
||||
function()
|
||||
if vim.o.virtualedit == "all" then
|
||||
vim.o.virtualedit = "block"
|
||||
else
|
||||
vim.o.virtualedit = "all"
|
||||
end
|
||||
end,
|
||||
{ desc = "virtualedit" },
|
||||
},
|
||||
{
|
||||
"i",
|
||||
function()
|
||||
if vim.o.list == true then
|
||||
vim.o.list = false
|
||||
else
|
||||
vim.o.list = true
|
||||
end
|
||||
end,
|
||||
{ desc = "show invisible" },
|
||||
},
|
||||
{
|
||||
"s",
|
||||
function()
|
||||
if vim.o.spell == true then
|
||||
vim.o.spell = false
|
||||
else
|
||||
vim.o.spell = true
|
||||
end
|
||||
end,
|
||||
{ desc = "spell" },
|
||||
},
|
||||
{
|
||||
"w",
|
||||
function()
|
||||
if vim.o.wrap ~= true then
|
||||
vim.o.wrap = true
|
||||
-- Dealing with word wrap:
|
||||
-- If cursor is inside very long line in the file than wraps
|
||||
-- around several rows on the screen, then 'j' key moves you to
|
||||
-- the next line in the file, but not to the next row on the
|
||||
-- screen under your previous position as in other editors. These
|
||||
-- bindings fixes this.
|
||||
vim.keymap.set("n", "k", function()
|
||||
return vim.v.count > 0 and "k" or "gk"
|
||||
end, { expr = true, desc = "k or gk" })
|
||||
vim.keymap.set("n", "j", function()
|
||||
return vim.v.count > 0 and "j" or "gj"
|
||||
end, { expr = true, desc = "j or gj" })
|
||||
else
|
||||
vim.o.wrap = false
|
||||
vim.keymap.del("n", "k")
|
||||
vim.keymap.del("n", "j")
|
||||
end
|
||||
end,
|
||||
{ desc = "wrap" },
|
||||
},
|
||||
{
|
||||
"c",
|
||||
function()
|
||||
if vim.o.cursorline == true then
|
||||
vim.o.cursorline = false
|
||||
else
|
||||
vim.o.cursorline = true
|
||||
end
|
||||
end,
|
||||
{ desc = "cursor line" },
|
||||
},
|
||||
{ "<Esc>", nil, { exit = true } },
|
||||
},
|
||||
})
|
30
dots/.config/nvim/lua/plugins/configs/indent-blankline.lua
Executable file
30
dots/.config/nvim/lua/plugins/configs/indent-blankline.lua
Executable file
@ -0,0 +1,30 @@
|
||||
local g = vim.g
|
||||
|
||||
g.indent_blankline_char = "▏"
|
||||
g.indent_blankline_context_char = "▏"
|
||||
|
||||
-- Disable indent-blankline on these pages.
|
||||
g.indent_blankline_filetype_exclude = {
|
||||
"help",
|
||||
"terminal",
|
||||
"alpha",
|
||||
"packer",
|
||||
"lsp-installer",
|
||||
"lspinfo",
|
||||
"mason.nvim",
|
||||
"mason",
|
||||
"man",
|
||||
"OverseerForm",
|
||||
"noice",
|
||||
"lazy",
|
||||
}
|
||||
|
||||
g.indent_blankline_buftype_exclude = { "terminal" }
|
||||
g.indent_blankline_show_trailing_blankline_indent = false
|
||||
g.indent_blankline_show_first_indent_level = true
|
||||
|
||||
require("indent_blankline").setup({
|
||||
-- space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
})
|
135
dots/.config/nvim/lua/plugins/configs/kanagawa.lua
Normal file
135
dots/.config/nvim/lua/plugins/configs/kanagawa.lua
Normal file
@ -0,0 +1,135 @@
|
||||
vim.opt.fillchars:append({
|
||||
horiz = "─",
|
||||
horizup = "┴",
|
||||
horizdown = "┬",
|
||||
vert = "│",
|
||||
vertleft = "┤",
|
||||
vertright = "├",
|
||||
verthoriz = "┼",
|
||||
})
|
||||
|
||||
require("kanagawa").setup({
|
||||
transparent = true,
|
||||
dim_inactive = true,
|
||||
globalStatus = true,
|
||||
theme = "dragon",
|
||||
colors = {
|
||||
theme = {
|
||||
all = {
|
||||
ui = {
|
||||
bg_gutter = "NONE",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
overrides = function(palette)
|
||||
local colors = palette.palette
|
||||
local overrides = {
|
||||
NeogitHunkHeader = { fg = colors.oniViolet, bg = colors.sumiInk1 },
|
||||
NeogitHunkHeaderHighlight = { fg = colors.winterYellow, bg = colors.oldWhite },
|
||||
NeogitDiffContextHighlight = { link = "CursorLine" },
|
||||
NeogitDiffDelete = { bg = colors.winterRed, fg = colors.autumnRed },
|
||||
NeogitDiffAdd = { bg = colors.winterGreen, fg = colors.autumnGreen },
|
||||
NeogitCommitViewHeader = { fg = colors.winterYellow, bg = colors.autumnYellow },
|
||||
menuSel = { bg = colors.sumiInk0, fg = "NONE" },
|
||||
Pmenu = { fg = colors.fujiWhite, bg = colors.sumiInk2 },
|
||||
CmpItemAbbrDeprecated = { fg = colors.fujiGray, bg = "NONE" },
|
||||
CmpItemAbbrMatch = { fg = colors.crystalBlue, bg = "NONE" },
|
||||
CmpItemAbbrMatchFuzzy = { fg = colors.crystalBlue, bg = "NONE" },
|
||||
CmpItemMenu = { fg = colors.roninYellow, bg = "NONE" },
|
||||
CmpItemKindField = { fg = colors.fujiWhite, bg = colors.sakuraPink },
|
||||
CmpItemKindProperty = { fg = colors.fujiWhite, bg = colors.sakuraPink },
|
||||
CmpItemKindEvent = { fg = colors.fujiWhite, bg = colors.sakuraPink },
|
||||
CmpItemKindText = { fg = colors.fujiWhite, bg = colors.dragonBlue },
|
||||
CmpItemKindEnum = { fg = colors.fujiWhite, bg = colors.crystalBlue },
|
||||
CmpItemKindKeyword = { fg = colors.fujiWhite, bg = colors.springBlue },
|
||||
CmpItemKindConstant = { fg = colors.fujiWhite, bg = colors.crystalBlue },
|
||||
CmpItemKindConstructor = { fg = colors.fujiWhite, bg = colors.crystalBlue },
|
||||
CmpItemKindReference = { fg = colors.fujiWhite, bg = colors.crystalBlue },
|
||||
CmpItemKindFunction = { fg = colors.fujiWhite, bg = colors.oniViolet },
|
||||
CmpItemKindStruct = { fg = colors.fujiWhite, bg = colors.oniViolet },
|
||||
CmpItemKindClass = { fg = colors.fujiWhite, bg = colors.oniViolet },
|
||||
CmpItemKindModule = { fg = colors.fujiWhite, bg = colors.oniViolet },
|
||||
CmpItemKindOperator = { fg = colors.fujiWhite, bg = colors.oniViolet },
|
||||
CmpItemKindVariable = { fg = colors.fujiWhite, bg = colors.roninYellow },
|
||||
CmpItemKindFile = { fg = colors.fujiWhite, bg = colors.autumnYellow },
|
||||
CmpItemKindUnit = { fg = colors.fujiWhite, bg = colors.autumnYellow },
|
||||
CmpItemKindSnippet = { fg = colors.fujiWhite, bg = colors.autumnYellow },
|
||||
CmpItemKindFolder = { fg = colors.fujiWhite, bg = colors.autumnYellow },
|
||||
CmpItemKindMethod = { fg = colors.fujiWhite, bg = colors.autumnGreen },
|
||||
CmpItemKindValue = { fg = colors.fujiWhite, bg = colors.autumnGreen },
|
||||
CmpItemKindEnumMember = { fg = colors.fujiWhite, bg = colors.autumnGreen },
|
||||
CmpItemKindInterface = { fg = colors.fujiWhite, bg = colors.waveRed },
|
||||
CmpItemKindColor = { fg = colors.fujiWhite, bg = colors.waveAqua2 },
|
||||
CmpItemKindTypeParameter = { fg = colors.fujiWhite, bg = colors.waveAqua2 },
|
||||
CmpCustomSelectionBuffer = { fg = colors.fujiWhite, bg = colors.dragonBlue },
|
||||
CmpCustomSelectionPath = { fg = colors.fujiWhite, bg = colors.autumnYellow },
|
||||
CmpCustomSelectionCalculator = { fg = colors.fujiWhite, bg = colors.waveBlue2 },
|
||||
CmpCustomSelectionNeorg = { fg = colors.fujiWhite, bg = colors.waveAqua1 },
|
||||
CmpCustomSelectionEmoji = { fg = colors.fujiWhite, bg = colors.dragonBlue },
|
||||
CmpCustomSelectionZsh = { fg = colors.fujiWhite, bg = colors.springGreen },
|
||||
CmpCustomSelectionCrates = { fg = colors.fujiWhite, bg = colors.roninYellow },
|
||||
CmpCustomSelectionCmdHistory = { fg = colors.fujiWhite, bg = colors.waveBlue2 },
|
||||
CmpCustomSelectionRipgrep = { fg = colors.fujiWhite, bg = colors.dragonBlue },
|
||||
CmpCustomSelectionNpm = { fg = colors.fujiWhite, bg = colors.peachRed },
|
||||
CmpCustomSelectionCommit = { fg = colors.fujiWhite, bg = colors.peachRed },
|
||||
CmpCustomSelectionSpell = { fg = colors.fujiWhite, bg = colors.waveRed },
|
||||
TelescopeNormal = { bg = colors.sumiInk1 },
|
||||
TelescopeBorder = { bg = colors.sumiInk1, fg = colors.sumiInk1 },
|
||||
TelescopePromptBorder = { bg = colors.sumiInk0, fg = colors.sumiInk0 },
|
||||
TelescopePromptTitle = { fg = colors.sumiInk0, bg = colors.oniViolet },
|
||||
TelescopePreviewTitle = { fg = colors.sumiInk0, bg = colors.sakuraPink },
|
||||
TelescopePreviewBorder = { bg = colors.sumiInk2, fg = colors.sumiInk2 },
|
||||
TelescopePreviewNormal = { bg = colors.sumiInk2 },
|
||||
TelescopeResultsTitle = { fg = "NONE", bg = "NONE" },
|
||||
WinSeparator = { fg = colors.sumiInk4, bg = "NONE" },
|
||||
MiniCursorword = { bg = colors.waveBlue2 },
|
||||
MiniCursorwordCurrent = { bg = colors.waveBlue2 },
|
||||
rainbowcol1 = { fg = colors.oniViolet },
|
||||
rainbowcol2 = { fg = colors.crystalBlue },
|
||||
rainbowcol3 = { fg = colors.lightBlue },
|
||||
rainbowcol4 = { fg = colors.sakuraPink },
|
||||
rainbowcol5 = { fg = colors.springGreen },
|
||||
rainbowcol6 = { fg = colors.springViolet2 },
|
||||
rainbowcol7 = { fg = colors.carpYellow },
|
||||
packerSuccess = { fg = colors.autumnGreen, bg = "NONE" },
|
||||
WinBar = { fg = colors.fujiWhite, bg = colors.sumiInk1 },
|
||||
WinBarNC = { fg = colors.fujiWhite, bg = colors.sumiInk1 },
|
||||
NeoTreeNormal = { bg = colors.sumiInk1 },
|
||||
NeoTreeNormalNC = { bg = colors.sumiInk1 },
|
||||
NoiceCmdlineIconCmdline = { fg = colors.oniViolet },
|
||||
NoiceCmdlinePopupBorderCmdline = { fg = colors.oniViolet },
|
||||
NoiceCmdlineIconFilter = { fg = colors.springGreen },
|
||||
NoiceCmdlinePopupBorderFilter = { fg = colors.springGreen },
|
||||
NoiceCmdLineIconLua = { fg = colors.crystalBlue },
|
||||
NoiceCmdlinePopupBorderLua = { fg = colors.crystalBlue },
|
||||
NoiceCmdlineIconHelp = { fg = colors.surimiOrange },
|
||||
NoiceCmdlinePopupBorderHelp = { fg = colors.surimiOrange },
|
||||
NoiceCmdLineIconSearch = { fg = colors.roninYellow },
|
||||
NoiceCmdlinePopupBorderSearch = { fg = colors.roninYellow },
|
||||
NoiceCmdlineIconIncRename = { fg = colors.peachRed },
|
||||
NoiceCmdlinePopupdBorderIncRename = { fg = colors.peachRed },
|
||||
Folded = { bg = colors.waveBlue1 },
|
||||
UfoFoldedBg = { bg = colors.waveBlue1 },
|
||||
TSRainbowRed = { fg = colors.peachRed },
|
||||
TSRainbowYellow = { fg = colors.carpYellow },
|
||||
TSRainbowBlue = { fg = colors.crystalBlue },
|
||||
TSRainbowGreen = { fg = colors.springGreen },
|
||||
TSRainbowViolet = { fg = colors.oniViolet },
|
||||
TSRainbowCyan = { fg = colors.lightBlue },
|
||||
SmoothCursorCursor = { fg = colors.roninYellow },
|
||||
SmoothCursorTrailBig1 = { fg = colors.autumnYellow },
|
||||
SmoothCursorTrailBig2 = { fg = colors.crystalBlue },
|
||||
SmoothCursorTrailMedium = { fg = colors.oniViolet },
|
||||
SmoothCursorTrailSmall = { fg = colors.springBlue },
|
||||
SmoothCursorTrailXSmall = { fg = colors.waveAqua2 },
|
||||
TreesitterContext = { bg = colors.sumiInk0 },
|
||||
FloatTitle = { bg = "NONE" },
|
||||
DiffviewFilePanelTitle = { fg = colors.crystalBlue },
|
||||
Headline = { bg = colors.sumiInk2 },
|
||||
HeadlineReversed = { bg = colors.sumiInk1 },
|
||||
}
|
||||
|
||||
return overrides
|
||||
end,
|
||||
})
|
341
dots/.config/nvim/lua/plugins/configs/lsp.lua
Executable file
341
dots/.config/nvim/lua/plugins/configs/lsp.lua
Executable file
@ -0,0 +1,341 @@
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local lspconfig = require("lspconfig")
|
||||
local async = require("plenary.async")
|
||||
|
||||
-- NOTE: Keep this near top
|
||||
mason_lspconfig.setup({
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
vim.notify("Attached server " .. client.name, "info", {
|
||||
title = "LSP",
|
||||
})
|
||||
end
|
||||
|
||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local opts = {
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
local lsp_server_bin_dir = vim.fn.stdpath("data") .. "/mason/bin/"
|
||||
local rust_tools = require("rust-tools")
|
||||
local codelldb_path = lsp_server_bin_dir .. "codelldb"
|
||||
local liblldb_path = vim.fn.stdpath("data") .. "/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
|
||||
local rustopts = {
|
||||
server = opts,
|
||||
dap = {
|
||||
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
|
||||
},
|
||||
tools = {
|
||||
-- how to execute terminal commands
|
||||
-- options right now: termopen / quickfix
|
||||
executor = require("rust-tools/executors").termopen,
|
||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||
on_initialized = nil,
|
||||
-- These apply to the default RustSetInlayHints command
|
||||
inlay_hints = {
|
||||
-- automatically set inlay hints (type hints)
|
||||
-- default: true
|
||||
auto = true,
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = true,
|
||||
-- prefix for parameter hints
|
||||
-- default: "<-"
|
||||
parameter_hints_prefix = "<- ",
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
-- default: "=>"
|
||||
other_hints_prefix = "=> ",
|
||||
-- whether to align to the lenght of the longest line in the file
|
||||
max_len_align = false,
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
},
|
||||
hover_actions = {
|
||||
auto_focus = true,
|
||||
},
|
||||
server = {
|
||||
on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "<leader>fr", rust_tools.runnables.runnables, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fd", rust_tools.debuggables.debuggables, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fp", rust_tools.parent_module.parent_module, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fJ", rust_tools.join_lines.join_lines, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fH", rust_tools.hover_range.hover_range, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fm", rust_tools.expand_macro.expand_macro, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fc", rust_tools.open_cargo_toml.open_cargo_toml, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fk", ":RustMoveItemUp<CR>", {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fj", ":RustMoveItemDown<CR>", {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fh", rust_tools.hover_actions.hover_actions, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>fa", rust_tools.code_action_group.code_action_group, {
|
||||
buffer = bufnr,
|
||||
})
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
rust_tools.setup(rustopts)
|
||||
|
||||
-- NOTE: ANSIBLE LSP
|
||||
-- I use ansible a lot, define exceptions for servers that can use
|
||||
-- server:setup & vim.cmd at the bottom here
|
||||
lspconfig.ansiblels.setup({
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
ansible = {
|
||||
ansible = {
|
||||
useFullyQualifiedCollectionNames = true,
|
||||
path = "ansible",
|
||||
},
|
||||
ansibleLint = {
|
||||
enabled = true,
|
||||
path = "ansible-lint",
|
||||
},
|
||||
python = {
|
||||
interpreterPath = "python3",
|
||||
},
|
||||
completion = {
|
||||
provideRedirectModules = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- NOTE: LUA LSP
|
||||
local luadev = require("neodev").setup({})
|
||||
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- NOTE: PYTHON LSP
|
||||
lspconfig.pylsp.setup({
|
||||
filetypes = { "python" },
|
||||
settings = {
|
||||
formatCommand = { "black" },
|
||||
pylsp = {
|
||||
plugins = {
|
||||
jedi_completion = {
|
||||
include_params = true,
|
||||
fuzzy = true,
|
||||
eager = true,
|
||||
},
|
||||
jedi_signature_help = { enabled = true },
|
||||
pyflakes = { enabled = true },
|
||||
pycodestyle = {
|
||||
enabled = true,
|
||||
ignore = { "E501", "E231", "W503", "E731" },
|
||||
maxLineLength = 120,
|
||||
},
|
||||
mypy = { enabled = true },
|
||||
yapf = { enabled = true },
|
||||
rope_completion = {
|
||||
enabled = true,
|
||||
eager = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig.yamlls.setup({
|
||||
settings = {
|
||||
redhat = {
|
||||
telemetry = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
yaml = {
|
||||
schemas = require("schemastore").yaml.schemas({}),
|
||||
},
|
||||
},
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig.csharp_ls.setup({
|
||||
handlers = {
|
||||
["textDocument/definition"] = require("csharpls_extended").handler,
|
||||
},
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- lspconfig.omnisharp.setup({
|
||||
-- cmd = {
|
||||
-- vim.fn.stdpath("data") .. "/mason/bin/omnisharp",
|
||||
-- "--languageserver",
|
||||
-- "--hostPID",
|
||||
-- tostring(vim.fn.getpid()),
|
||||
-- },
|
||||
--
|
||||
-- handlers = {
|
||||
-- ["textDocument/definition"] = require("omnisharp_extended").handler,
|
||||
-- },
|
||||
-- enable_import_completion = true,
|
||||
-- enable_roslyn_analyzers = true,
|
||||
-- organize_imports_on_format = true,
|
||||
-- capabilities = lsp_capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- })
|
||||
|
||||
lspconfig.jsonls.setup({
|
||||
settings = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig.powershell_es.setup({
|
||||
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services/",
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
lspconfig.azure_pipelines_ls.setup({
|
||||
cmd = { lsp_server_bin_dir .. "azure-pipelines-language-server", "--stdio" },
|
||||
settings = {
|
||||
redhat = {
|
||||
telemetry = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
yaml = {
|
||||
schemas = require("schemastore").yaml.schemas({
|
||||
replace = {
|
||||
["Azure Pipelines"] = {
|
||||
description = "Azure Pipelines override",
|
||||
fileMatch = {
|
||||
"/azure-pipeline*.y*l",
|
||||
"/*.azure*",
|
||||
"Azure-Pipelines/**/*.y*l",
|
||||
"Pipelines/*.y*l",
|
||||
},
|
||||
name = "Azure Pipelines",
|
||||
url = "https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json",
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
},
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
local path = vim.fn.stdpath("config") .. "/spell/en.utf-8.add"
|
||||
local words = {}
|
||||
|
||||
for word in io.open(path, "r"):lines() do
|
||||
table.insert(words, word)
|
||||
end
|
||||
|
||||
-- lspconfig.ltex.setup({
|
||||
-- settings = {
|
||||
-- ltex = {
|
||||
-- dictionary = {
|
||||
-- ["en-US"] = words,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- filetypes = { "bib", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc" },
|
||||
-- capabilities = lsp_capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- })
|
||||
|
||||
-- NOTE: GENERIC LSP SERVERS
|
||||
for _, server in ipairs({
|
||||
"clangd",
|
||||
"cmake",
|
||||
"bashls",
|
||||
"dockerls",
|
||||
"docker_compose_language_service",
|
||||
"eslint",
|
||||
"html",
|
||||
"cssls",
|
||||
"jdtls",
|
||||
"kotlin_language_server",
|
||||
"terraformls",
|
||||
"tflint",
|
||||
"tsserver",
|
||||
"vimls",
|
||||
"vuels",
|
||||
"tsserver",
|
||||
"rnix",
|
||||
"marksman",
|
||||
"texlab",
|
||||
"ltex",
|
||||
}) do
|
||||
lspconfig[server].setup(opts)
|
||||
end
|
||||
|
||||
-- Custom Servers outside of lspconfig
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "nginx",
|
||||
desc = "Nginx Language Server Handler",
|
||||
callback = function()
|
||||
local client_id = vim.lsp.start({
|
||||
name = "Nginx-ls",
|
||||
cmd = { lsp_server_bin_dir .. "nginx-language-server" },
|
||||
root_dir = vim.fn.getcwd(),
|
||||
capabilities = lsp_capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
if client_id then
|
||||
vim.lsp.buf_attach_client(0, client_id)
|
||||
end
|
||||
end,
|
||||
})
|
8
dots/.config/nvim/lua/plugins/configs/neoformat.lua
Executable file
8
dots/.config/nvim/lua/plugins/configs/neoformat.lua
Executable file
@ -0,0 +1,8 @@
|
||||
vim.cmd([[
|
||||
let g:neoformat_python_black = {
|
||||
\ 'exe': 'black',
|
||||
\ 'stdin': 1,
|
||||
\ 'args': ['-q', '-'],
|
||||
\ }
|
||||
let g:neoformat_enabled_python = ['black']
|
||||
]])
|
14
dots/.config/nvim/lua/plugins/configs/neotree.lua
Normal file
14
dots/.config/nvim/lua/plugins/configs/neotree.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local neotree = require("neo-tree")
|
||||
|
||||
vim.g.neo_tree_remove_legacy_commands = 1
|
||||
neotree.setup({
|
||||
filesystem = {
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
window = {
|
||||
mappings = {
|
||||
["<space>"] = "none",
|
||||
["/"] = "none",
|
||||
},
|
||||
},
|
||||
})
|
1
dots/.config/nvim/lua/plugins/configs/noice.lua
Normal file
1
dots/.config/nvim/lua/plugins/configs/noice.lua
Normal file
@ -0,0 +1 @@
|
||||
require("noice").setup({})
|
16
dots/.config/nvim/lua/plugins/configs/null_ls.lua
Executable file
16
dots/.config/nvim/lua/plugins/configs/null_ls.lua
Executable file
@ -0,0 +1,16 @@
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
extra_args = { "-i 4" },
|
||||
}),
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.diagnostics.hadolint,
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
},
|
||||
})
|
34
dots/.config/nvim/lua/plugins/configs/nvim-notify.lua
Executable file
34
dots/.config/nvim/lua/plugins/configs/nvim-notify.lua
Executable file
@ -0,0 +1,34 @@
|
||||
require("notify").setup({
|
||||
-- Animation style (see below for details)
|
||||
stages = "fade_in_slide_out",
|
||||
|
||||
-- Function called when a new window is opened, use for changing win settings/config
|
||||
on_open = nil,
|
||||
|
||||
-- Function called when a window is closed
|
||||
on_close = nil,
|
||||
|
||||
-- Render function for notifications. See notify-render()
|
||||
render = "default",
|
||||
|
||||
-- Default timeout for notifications
|
||||
timeout = 5000,
|
||||
|
||||
-- For stages that change opacity this is treated as the highlight behind the window
|
||||
-- Set this to either a highlight group, an RGB hex value e.g. "#000000" or a function returning an RGB code for dynamic values
|
||||
background_colour = "#000000",
|
||||
|
||||
-- Minimum width for notification windows
|
||||
minimum_width = 50,
|
||||
|
||||
-- Icons for the different levels
|
||||
icons = {
|
||||
ERROR = "",
|
||||
WARN = "",
|
||||
INFO = "",
|
||||
DEBUG = "",
|
||||
TRACE = "✎",
|
||||
},
|
||||
})
|
||||
|
||||
-- vim.notify = require('notify')
|
46
dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua
Normal file
46
dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua
Normal file
@ -0,0 +1,46 @@
|
||||
vim.o.foldcolumn = "1"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
|
||||
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
|
||||
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
|
||||
|
||||
-- Show numbers for fold text
|
||||
local handler = function(virtText, lnum, endLnum, width, truncate)
|
||||
local newVirtText = {}
|
||||
local suffix = (" %d "):format(endLnum - lnum)
|
||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||
local targetWidth = width - sufWidth
|
||||
local curWidth = 0
|
||||
for _, chunk in ipairs(virtText) do
|
||||
local chunkText = chunk[1]
|
||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
if targetWidth > curWidth + chunkWidth then
|
||||
table.insert(newVirtText, chunk)
|
||||
else
|
||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||
local hlGroup = chunk[2]
|
||||
table.insert(newVirtText, { chunkText, hlGroup })
|
||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||
if curWidth + chunkWidth < targetWidth then
|
||||
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||
end
|
||||
break
|
||||
end
|
||||
curWidth = curWidth + chunkWidth
|
||||
end
|
||||
table.insert(newVirtText, { suffix, "@conditional" })
|
||||
return newVirtText
|
||||
end
|
||||
|
||||
local ft_options = { norg = "" }
|
||||
require("ufo").setup({
|
||||
provider_selector = function(bufnr, filetype, buftype)
|
||||
return ft_options[filetype] or { "treesitter", "indent" }
|
||||
end,
|
||||
fold_virt_text_handler = handler,
|
||||
disabled = { "norg" },
|
||||
})
|
3
dots/.config/nvim/lua/plugins/configs/python-dap.lua
Executable file
3
dots/.config/nvim/lua/plugins/configs/python-dap.lua
Executable file
@ -0,0 +1,3 @@
|
||||
local dap_python = require("dap-python")
|
||||
dap_python.setup(vim.fn.stdpath("data") .. "/mason/packages/debugpy/venv/bin/python3")
|
||||
dap_python.test_runner = "pytest"
|
272
dots/.config/nvim/lua/plugins/configs/statusline.lua
Executable file
272
dots/.config/nvim/lua/plugins/configs/statusline.lua
Executable file
@ -0,0 +1,272 @@
|
||||
local util = require("utils.funcs")
|
||||
local present, lualine = pcall(require, "lualine")
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
-- Thanks to rockyzhang24 (github.com/rockyzhang24)
|
||||
|
||||
local function simplifiedMode(str)
|
||||
return " " .. (str == "V-LINE" and "VL" or (str == "V-BLOCK" and "VB" or str:sub(1, 1)))
|
||||
end
|
||||
|
||||
-- For location, show total lines
|
||||
local function customLocation(str)
|
||||
return string.gsub(str, "%w+", "%1" .. "/%%L", 1)
|
||||
end
|
||||
|
||||
-- For progress, add a fancy icon
|
||||
local function customProgress(str)
|
||||
return " " .. str
|
||||
end
|
||||
|
||||
-- For filename, show the filename and the filesize
|
||||
local function fileNameAndSize(str)
|
||||
-- For doc, only show filename
|
||||
if string.find(str, ".*/doc/.*%.txt") then
|
||||
str = vim.fn.expand("%:t")
|
||||
end
|
||||
local size = require("lualine.components.filesize")()
|
||||
return size == "" and str or str .. " [" .. size .. "]"
|
||||
end
|
||||
|
||||
local function show_macro_recording()
|
||||
local recording_register = vim.fn.reg_recording()
|
||||
if recording_register == "" then
|
||||
return ""
|
||||
else
|
||||
return "Recording @" .. recording_register
|
||||
end
|
||||
end
|
||||
|
||||
local show_lsp_name = {
|
||||
function()
|
||||
local msg = "No Active Lsp"
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
else
|
||||
msg = ""
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
if msg == "" then
|
||||
msg = client.name
|
||||
else
|
||||
msg = msg .. ", " .. client.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = " LSP:",
|
||||
color = { fg = "#957fb8" },
|
||||
}
|
||||
|
||||
local LuaLineDateTimeHls = function()
|
||||
return {
|
||||
normal = {
|
||||
fg = "#957FB8",
|
||||
bg = util.get_color("lualine_c_normal", "bg#"),
|
||||
},
|
||||
hour_changed = {
|
||||
fg = "#FFA066",
|
||||
bg = util.get_color("lualine_c_normal", "bg#"),
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
vim.api.nvim_set_hl(0, "LuaLineDateTime", LuaLineDateTimeHls().normal)
|
||||
|
||||
local datetime_section = function()
|
||||
return os.date("%I:%M %p")
|
||||
end
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
},
|
||||
winbar = {
|
||||
lualine_a = {
|
||||
{
|
||||
"filename",
|
||||
path = 1,
|
||||
},
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
"macro-recording",
|
||||
color = {
|
||||
fg = "#FF9E3B",
|
||||
},
|
||||
fmt = show_macro_recording,
|
||||
},
|
||||
show_lsp_name,
|
||||
{
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {
|
||||
"encoding",
|
||||
"fileformat",
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"location",
|
||||
fmt = customLocation,
|
||||
},
|
||||
},
|
||||
lualine_z = {
|
||||
{
|
||||
"progress",
|
||||
fmt = customProgress,
|
||||
},
|
||||
},
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = { { "filename", path = 1 } },
|
||||
lualine_b = { show_lsp_name },
|
||||
lualine_c = {},
|
||||
lualine_x = {
|
||||
"filetype",
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
"mode",
|
||||
fmt = simplifiedMode,
|
||||
},
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
"branch",
|
||||
icon = "",
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = { added = " ", modified = " ", removed = " " },
|
||||
},
|
||||
{
|
||||
"macro-recording",
|
||||
color = {
|
||||
fg = "#FF9E3B",
|
||||
},
|
||||
fmt = show_macro_recording,
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
"filename",
|
||||
path = 3,
|
||||
symbols = {
|
||||
modified = "[+]",
|
||||
readonly = "[]",
|
||||
unnamed = "[No Name]",
|
||||
},
|
||||
fmt = fileNameAndSize,
|
||||
},
|
||||
},
|
||||
|
||||
-- Right
|
||||
lualine_x = {
|
||||
{
|
||||
function()
|
||||
local lazy_stats = require("lazy").stats()
|
||||
local plugin_count = lazy_stats.count
|
||||
local loaded_plugins = lazy_stats.loaded
|
||||
return "" .. loaded_plugins .. "/" .. plugin_count .. " "
|
||||
end,
|
||||
},
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
},
|
||||
{
|
||||
"datetime",
|
||||
fmt = datetime_section,
|
||||
color = "LuaLineDateTime",
|
||||
separator = {
|
||||
right = "%#lualine_transitional_lualine_b_normal_to_lualine_c_normal#",
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_y = {
|
||||
{
|
||||
"buffers",
|
||||
mode = 2,
|
||||
show_filename_only = false
|
||||
},
|
||||
},
|
||||
lualine_z = {
|
||||
{ "tabs" },
|
||||
},
|
||||
},
|
||||
inactive_sections = {},
|
||||
tabline = {},
|
||||
extensions = {
|
||||
"aerial",
|
||||
"fugitive",
|
||||
"nvim-tree",
|
||||
"neo-tree",
|
||||
"quickfix",
|
||||
"toggleterm",
|
||||
},
|
||||
})
|
||||
|
||||
local macro_refresh_places = { "statusline", "winbar" }
|
||||
vim.api.nvim_create_autocmd("RecordingEnter", {
|
||||
callback = function()
|
||||
lualine.refresh({
|
||||
place = macro_refresh_places,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("RecordingLeave", {
|
||||
callback = function()
|
||||
local timer = vim.loop.new_timer()
|
||||
timer:start(
|
||||
30,
|
||||
0,
|
||||
vim.schedule_wrap(function()
|
||||
lualine.refresh({
|
||||
place = macro_refresh_places,
|
||||
})
|
||||
end)
|
||||
)
|
||||
timer:close()
|
||||
end,
|
||||
})
|
||||
|
||||
local last_date_hour = tonumber(os.date("%H"))
|
||||
local date_timer = vim.loop.new_timer()
|
||||
date_timer:start(
|
||||
100,
|
||||
1000,
|
||||
vim.schedule_wrap(function()
|
||||
vim.api.nvim_set_hl(0, "LuaLineDateTime", LuaLineDateTimeHls().normal)
|
||||
local curr_date_hour = tonumber(os.date("%H"))
|
||||
if curr_date_hour ~= last_date_hour then
|
||||
vim.api.nvim_set_hl(0, "LuaLineDateTime", LuaLineDateTimeHls().hour_changed)
|
||||
end
|
||||
last_date_hour = curr_date_hour
|
||||
lualine.refresh({
|
||||
place = { "datetime" },
|
||||
})
|
||||
end)
|
||||
)
|
149
dots/.config/nvim/lua/plugins/configs/telescope-nvim.lua
Executable file
149
dots/.config/nvim/lua/plugins/configs/telescope-nvim.lua
Executable file
@ -0,0 +1,149 @@
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
find_command = {
|
||||
"fd",
|
||||
},
|
||||
hidden = true,
|
||||
},
|
||||
},
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--hidden",
|
||||
"--smart-case",
|
||||
},
|
||||
history = {
|
||||
path = "~/.local/share/nvim/databases/telescope_history.sqlite3",
|
||||
limit = 1000,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-d>"] = actions.cycle_history_next,
|
||||
["<C-s>"] = actions.cycle_history_prev,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
vertical = {
|
||||
prompt_position = "top",
|
||||
width = 0.90,
|
||||
height = 0.98,
|
||||
preview_height = 0.65,
|
||||
},
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
width = 0.90,
|
||||
height = 0.98,
|
||||
preview_width = 0.70,
|
||||
},
|
||||
flex = {
|
||||
flip_cloumns = 120,
|
||||
},
|
||||
},
|
||||
file_sorter = require("telescope.sorters").get_fuzzy_file,
|
||||
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
|
||||
path_display = { "truncate" },
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { " ", "", "", "", "", "", "", "" },
|
||||
results_title = false,
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" },
|
||||
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
|
||||
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
|
||||
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
|
||||
},
|
||||
extensions = {
|
||||
media_files = {
|
||||
filetypes = { "png", "webp", "jpg", "jpeg" },
|
||||
find_cmd = "rg",
|
||||
},
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
undo = {
|
||||
side_by_side = true,
|
||||
use_delta = true,
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-cr>"] = require("telescope-undo.actions").yank_additions,
|
||||
["<S-cr>"] = require("telescope-undo.actions").yank_deletions,
|
||||
["<cr>"] = require("telescope-undo.actions").restore,
|
||||
},
|
||||
},
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
preview_height = 0.8,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("media_files")
|
||||
telescope.load_extension("find_directories")
|
||||
telescope.load_extension("file_browser")
|
||||
telescope.load_extension("notify")
|
||||
telescope.load_extension("fzf")
|
||||
telescope.load_extension("ui-select")
|
||||
telescope.load_extension("smart_history")
|
||||
telescope.load_extension("undo")
|
||||
|
||||
vim.api.nvim_create_user_command("Search", function()
|
||||
-- Thank you u/SPEKTRUMdagreat :)
|
||||
local search = vim.fn.input("Search: ")
|
||||
local pickers = require("telescope.pickers")
|
||||
local finders = require("telescope.finders")
|
||||
local conf = require("telescope.config").values
|
||||
---@diagnostic disable-next-line: redefined-local
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
-- our picker function: colors
|
||||
local searcher = function(opts)
|
||||
opts = opts or {}
|
||||
pickers
|
||||
.new(opts, {
|
||||
prompt_title = "OmniSearch",
|
||||
finder = finders.new_table({
|
||||
results = {
|
||||
{ "Stack Overflow", ("www.stackoverflow.com/search\\?q\\=" .. search:gsub(" ", "+")) },
|
||||
{ "Google Search", ("www.google.com/search\\?q\\=" .. search:gsub(" ", "+")) },
|
||||
{ "Youtube", ("https://www.youtube.com/results\\?search_query\\=" .. search:gsub(" ", "+")) },
|
||||
{ "Wikipedia", ("https://en.wikipedia.org/w/index.php\\?search\\=" .. search:gsub(" ", "+")) },
|
||||
{ "Github", ("https://github.com/search\\?q\\=" .. search:gsub(" ", "+")) },
|
||||
},
|
||||
entry_maker = function(entry)
|
||||
return { value = entry, display = entry[1], ordinal = entry[1] }
|
||||
end,
|
||||
}),
|
||||
sorter = conf.generic_sorter(opts),
|
||||
attach_mappings = function(prompt_bufnr, map)
|
||||
actions.select_default:replace(function()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
vim.cmd(("silent execute '!firefox-developer-edition %s &'"):format(selection["value"][2]))
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
:find()
|
||||
end
|
||||
searcher(require("telescope.themes").get_dropdown({}))
|
||||
end, { nargs = 0 })
|
1
dots/.config/nvim/lua/plugins/configs/todo-comments.lua
Executable file
1
dots/.config/nvim/lua/plugins/configs/todo-comments.lua
Executable file
@ -0,0 +1 @@
|
||||
require("todo-comments").setup({})
|
34
dots/.config/nvim/lua/plugins/configs/treesitter.lua
Executable file
34
dots/.config/nvim/lua/plugins/configs/treesitter.lua
Executable file
@ -0,0 +1,34 @@
|
||||
local nvim_treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
nvim_treesitter.setup({
|
||||
ensure_installed = { "norg" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(_, buf)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
matchup = { enable = true },
|
||||
autotag = { enable = true },
|
||||
indent = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
query = "rainbow-parens",
|
||||
strategy = {
|
||||
on_attach = function()
|
||||
if vim.fn.line("$") < 1000 then
|
||||
require("ts-rainbow.strategy.local")
|
||||
elseif vim.fn.line("$") < 10000 then
|
||||
require("ts-rainbow.strategy.global")
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("treesitter-context").setup({})
|
||||
vim.cmd.TSContextEnable()
|
1
dots/.config/nvim/lua/plugins/init.lua
Executable file
1
dots/.config/nvim/lua/plugins/init.lua
Executable file
@ -0,0 +1 @@
|
||||
require("plugins.plugins")
|
219
dots/.config/nvim/lua/plugins/mappings.lua
Executable file
219
dots/.config/nvim/lua/plugins/mappings.lua
Executable file
@ -0,0 +1,219 @@
|
||||
local loaded = pcall(require, "plenary.async")
|
||||
|
||||
if not loaded then
|
||||
return
|
||||
end
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
-- Telescope mappings
|
||||
wk.register({
|
||||
t = {
|
||||
name = "Telescope",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.keymap.set("n", "<Leader>tw", ":Telescope live_grep<CR>", { silent = true, desc = "Telescope: Grep for Word" })
|
||||
vim.keymap.set("n", "<Leader>tgs", ":Telescope git_status<CR>", { silent = true, desc = "Telescope: Git Status" })
|
||||
vim.keymap.set("n", "<Leader>tgc", ":Telescope git_commits<CR>", { silent = true, desc = "Telescope: Git Commits" })
|
||||
vim.keymap.set("n", "<Leader>tgb", ":Telescope git_branches<CR>", { silent = true, desc = "Telescope: Git Branches" })
|
||||
vim.keymap.set("n", "<Leader>tf", ":Telescope find_files<CR>", { silent = true, desc = "Telescope: Find Files" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<Leader>td",
|
||||
":Telescope find_directories<CR>",
|
||||
{ silent = true, desc = "Telescope: Find Directories" }
|
||||
)
|
||||
vim.keymap.set("n", "<Leader>tb", ":Telescope buffers<CR>", { silent = true, desc = "Telescope: Buffers" })
|
||||
vim.keymap.set("n", "<Leader>th", ":Telescope help_tags<CR>", { silent = true, desc = "Telescope: Help Tags" })
|
||||
vim.keymap.set("n", "<Leader>to", ":Telescope oldfiles<CR>", { silent = true, desc = "Telescope: Recent Files" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>tn",
|
||||
":Telescope neoclip default<CR>",
|
||||
{ silent = true, desc = "Telescope: Neoclip Buffer" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>tr", ":Telescope registers<CR>", { silent = true, desc = "Telescope: Registers" })
|
||||
vim.keymap.set("n", "<leader>tt", ":Telescope file_browser<CR>", { silent = true, desc = "Telescope: File Tree" })
|
||||
vim.keymap.set("n", "<leader>ts", ":Telescope spell_suggest<CR>", { silent = true, desc = "Telescope: Spell Suggest" })
|
||||
vim.keymap.set("n", "<leader>tl", ":Telescope resume<CR>", { silent = true, desc = "Telescope: Previous State" })
|
||||
vim.keymap.set("n", "<leader>tT", ":TodoTelescope<CR>", { silent = true, desc = "Telescope: Todo Items" })
|
||||
vim.keymap.set("n", "<leader>tk", ":Telescope keymaps<CR>", { silent = true, desc = "Telescope: Keymaps" })
|
||||
vim.keymap.set("n", "<leader>tc", ":Telescope commands<CR>", { silent = true, desc = "Telescope: Commands" })
|
||||
vim.keymap.set("n", "<leader>tu", ":Telescope undo<CR>", { silent = true, desc = "Telescope: Undo History" })
|
||||
|
||||
-- Lsp Mappings
|
||||
|
||||
wk.register({
|
||||
l = {
|
||||
name = "LSP",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.keymap.set("n", "<leader>lD", vim.lsp.buf.declaration, { silent = true, desc = "LSP: Declaration" })
|
||||
vim.keymap.set("n", "<leader>ld", vim.lsp.buf.definition, { silent = true, desc = "LSP: Definition" })
|
||||
vim.keymap.set("n", "<leader>k", vim.lsp.buf.hover, { silent = true, desc = "LSP: Hover" })
|
||||
vim.keymap.set("n", "<leader>K", vim.lsp.buf.signature_help, { silent = true, desc = "LSP: Sig Help" })
|
||||
vim.keymap.set("n", "<leader>li", vim.lsp.buf.implementation, { silent = true, desc = "LSP: Implementation" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>la",
|
||||
vim.lsp.buf.add_workspace_folder,
|
||||
{ silent = true, desc = "LSP: Add Workspace Folder" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>lx",
|
||||
vim.lsp.buf.remove_workspace_folder,
|
||||
{ silent = true, desc = "LSP: Remove Workspace Folder" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>ll", function()
|
||||
local output_workspaces = ""
|
||||
for _, workspace in ipairs(vim.lsp.buf.list_workspace_folders()) do
|
||||
output_workspaces = string.format("%s- %s\n", output_workspaces, vim.inspect(workspace):gsub('%"', ""))
|
||||
end
|
||||
vim.notify(output_workspaces:gsub("\n[^\n]*$", ""), "info", { title = "LSP: Workspaces" })
|
||||
end, { silent = true, desc = "LSP: List Workspaces" })
|
||||
vim.keymap.set("n", "<leader>ln", ":IncRename ", { silent = true, desc = "LSP: Rename" })
|
||||
vim.keymap.set("n", "<leader>lc", vim.lsp.buf.code_action, { silent = true, desc = "LSP: Code Action" })
|
||||
vim.keymap.set("n", "<leader>lr", vim.lsp.buf.references, { silent = true, desc = "LSP: References" })
|
||||
vim.keymap.set("n", "<leader>lR", ":LspRestart<CR>", { silent = true, desc = "LSP: Restart" })
|
||||
vim.keymap.set("n", "<leader>ls", function()
|
||||
vim.diagnostic.open_float(nil, { focus = true, scope = "cursor" })
|
||||
vim.cmd.vsplit()
|
||||
end, { silent = true, desc = "LSP: Diagnostic Open Float" })
|
||||
vim.keymap.set("n", "<leader>lf", function()
|
||||
vim.lsp.buf.format({ async = true })
|
||||
end, { silent = true, desc = "LSP: Format" })
|
||||
vim.keymap.set("n", "[l", vim.diagnostic.goto_prev, { silent = true, desc = "LSP: Diagnostic Previous" })
|
||||
vim.keymap.set("n", "]l", vim.diagnostic.goto_next, { silent = true, desc = "LSP: Diagnostic Next" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>lq",
|
||||
":Telescope diagnostics bufnr=0<CR>",
|
||||
{ silent = true, desc = "LSP: Telescope Diagnostics" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>lt", function()
|
||||
local virtual_lines_enabled = not vim.diagnostic.config().virtual_lines
|
||||
vim.diagnostic.config({ virtual_lines = virtual_lines_enabled, virtual_text = not virtual_lines_enabled })
|
||||
end, {
|
||||
desc = "LSP: Toggle Diagnostic Style",
|
||||
})
|
||||
|
||||
-- Formatter
|
||||
vim.keymap.set("n", "<leader>nf", ":Neoformat<CR>", { silent = true, desc = "Neoformat" })
|
||||
|
||||
-- DAP Mappings
|
||||
wk.register({
|
||||
d = {
|
||||
name = "DAP",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
local dap = require("dap")
|
||||
vim.keymap.set("n", "<leader>dc", dap.continue, { silent = true, desc = "DAP: Continue" })
|
||||
vim.keymap.set("n", "<leader>de", dap.terminate, { silent = true, desc = "DAP: Terminate" })
|
||||
vim.keymap.set("n", "<leader>db", dap.toggle_breakpoint, { silent = true, desc = "DAP: Toggle Breakpoint" })
|
||||
vim.keymap.set("n", "<leader>dr", function()
|
||||
dap.set_breakpoint(vim.fn.input("Breakpoint Condition: "))
|
||||
end, { silent = true, desc = "DAP: Set Conditional Breakpoint" })
|
||||
|
||||
vim.keymap.set("n", "<leader>dp", function()
|
||||
dap.set_breakpoint(nil, nil, vim.fn.input("Log point message: "))
|
||||
end, { silent = true, desc = "DAP: Set Log Breakpoint" })
|
||||
vim.keymap.set("n", "<F5>", dap.step_over, { silent = true, desc = "DAP: Step Over" })
|
||||
vim.keymap.set("n", "<F6>", dap.step_into, { silent = true, desc = "DAP: Step Into" })
|
||||
vim.keymap.set("n", "<F7>", dap.step_out, { silent = true, desc = "DAP: Step Out" })
|
||||
vim.keymap.set("n", "<F8>", dap.step_back, { silent = true, desc = "DAP: Step Back" })
|
||||
vim.keymap.set("n", "<leader>dR", dap.run_to_cursor, { silent = true, desc = "DAP: Run to Cursor" })
|
||||
vim.keymap.set("n", "<leader>do", dap.repl.open, { silent = true, desc = "DAP: Open Repl" })
|
||||
vim.keymap.set("n", "<leader>dt", require("dapui").toggle, { silent = true, desc = "DAP: Toggle UI" })
|
||||
vim.keymap.set("n", "<leader>dl", dap.run_last, { silent = true, desc = "DAP: Run Last" })
|
||||
|
||||
-- Comments
|
||||
vim.keymap.set("n", "<leader>/", ":CommentToggle<CR>", { silent = true, desc = "Toggle Comment" })
|
||||
vim.keymap.set("v", "<leader>/", ":'<,'>CommentToggle<CR>", { silent = true, desc = "Toggle Selection Comment" })
|
||||
|
||||
-- Buffer mappings
|
||||
vim.keymap.set("n", "<A-a>", ":bprevious<CR>", { silent = true, desc = "Go to Previous Buffer" })
|
||||
vim.keymap.set("n", "<A-s>", ":bnext<CR>", { silent = true, desc = "Go to Next Buffer" })
|
||||
vim.keymap.set("n", "<A-x>", function()
|
||||
require("bufdelete").bufdelete(0)
|
||||
end, { silent = true, desc = "Close Buffer" })
|
||||
|
||||
-- Vim Notify Mappings
|
||||
vim.keymap.set("n", "<leader>nv", ":Telescope notify<CR>", { silent = true, desc = "Notifications: Search" })
|
||||
vim.keymap.set("n", "<leader>nd", require("notify").dismiss, { silent = true, desc = "Notifications: Dismiss" })
|
||||
|
||||
-- Whichkey Mappings
|
||||
vim.keymap.set("n", "<leader>ww", ":WhichKey<CR>", { silent = true, desc = "Show Keybinds" })
|
||||
|
||||
-- Neogen Mappings
|
||||
wk.register({
|
||||
n = {
|
||||
g = {
|
||||
name = "Neogen",
|
||||
},
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.keymap.set("n", "<leader>ngf", ":Neogen func<CR>", { silent = true, desc = "Neogen: Function Annotation" })
|
||||
vim.keymap.set("n", "<leader>ngc", ":Neogen class<CR>", { silent = true, desc = "Neogen: Class Annotation" })
|
||||
vim.keymap.set("n", "<leader>ngt", ":Neogen type<CR>", { silent = true, desc = "Neogen: Type Annotation" })
|
||||
vim.keymap.set("n", "<leader>ngb", ":Neogen file<CR>", { silent = true, desc = "Neogen: File Annotation" })
|
||||
|
||||
-- Nvim Tree Mappings
|
||||
vim.keymap.set("n", "<leader>nt", ":Neotree show toggle focus<cr>", { silent = true, desc = "Neotree: Toggle" })
|
||||
|
||||
-- Plenary Mappings
|
||||
vim.keymap.set("n", "<leader>pt", "<Plug>PlenaryTestFile", { silent = true, desc = "Plenary: Test File" })
|
||||
|
||||
-- Neogit Mappings
|
||||
wk.register({
|
||||
g = {
|
||||
name = "Git",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.keymap.set("n", "<leader>gg", require("neogit").open, { silent = true, desc = "Neogit: Open" })
|
||||
|
||||
-- Gitsigns Mappings
|
||||
vim.keymap.set("n", "]g", "<cmd>Gitsigns next_hunk<CR><CR>", { silent = true, desc = "Gitsigns: Next Hunk" })
|
||||
vim.keymap.set("n", "[g", "<cmd>Gitsigns prev_hunk<CR><CR>", { silent = true, desc = "Gitsigns: Prev Hunk" })
|
||||
vim.keymap.set("n", "<leader>gs", "<cmd>Gitsigns stage_hunk<CR>", { silent = true, desc = "Gitsigns: Stage Hunk" })
|
||||
vim.keymap.set("n", "<leader>gr", "<cmd>Gitsigns reset_hunk<CR>", { silent = true, desc = "Gitsigns: Reset Hunk" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>gu",
|
||||
"<cmd>Gitsigns undo_stage_hunk<CR>",
|
||||
{ silent = true, desc = "Gitsigns: Unstage Hunk" }
|
||||
)
|
||||
|
||||
-- Diffview Mappings
|
||||
vim.keymap.set("n", "<leader>gd", "<cmd>DiffviewOpen<CR>", { silent = true, desc = "Diff View: Open" })
|
||||
vim.keymap.set("n", "<leader>gh", "<cmd>DiffviewFileHistory<CR>", { silent = true, desc = "Diff View: File History" })
|
||||
|
||||
-- Hop Mappings
|
||||
local hop = require("hop")
|
||||
|
||||
vim.keymap.set("", "f", function()
|
||||
hop.hint_char1({
|
||||
current_line_only = false,
|
||||
})
|
||||
end, { silent = true, desc = "Hop: Character" })
|
||||
|
||||
-- Hop Bindings
|
||||
vim.keymap.set("", ";l", "<cmd>HopLineStart<CR>", { silent = true, desc = "Hop: Line Start" })
|
||||
vim.keymap.set("", ";s", "<cmd>HopPattern<CR>", { silent = true, desc = "Hop: Pattern" })
|
||||
vim.keymap.set("", ";;", "<cmd>HopWord<CR>", { silent = true, desc = "Hop: Word" })
|
||||
vim.keymap.set("", ";a", "<cmd>HopAnywhere<CR>", { silent = true, desc = "Hop: Anywhere" })
|
||||
vim.keymap.set("", ";v", "<cmd>HopVertical<CR>", { silent = true, desc = "Hop Vertical" })
|
||||
|
||||
-- Term/Open bindings
|
||||
vim.keymap.set("n", "<leader><leader>", "<cmd>ToggleTerm<CR>", { silent = true, desc = "Toggle Terminal" })
|
||||
|
||||
-- Overseer mappings
|
||||
wk.register({
|
||||
o = {
|
||||
name = "Overseer",
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
vim.keymap.set("n", "<leader>or", vim.cmd.OverseerRun, { silent = true, desc = "Overseer: Run" })
|
||||
vim.keymap.set("n", "<leader>ot", vim.cmd.OverseerToggle, { silent = true, desc = "Overseer: Toggle" })
|
||||
|
||||
vim.keymap.set("v", "<leader>sc", ":'<,'>Silicon<CR>", { silent = true, desc = "Silicon: Copy" })
|
894
dots/.config/nvim/lua/plugins/plugins.lua
Executable file
894
dots/.config/nvim/lua/plugins/plugins.lua
Executable file
@ -0,0 +1,894 @@
|
||||
-- Packer strap, install packer automatically and configure plugins
|
||||
-- See the end of this file for how the variable `packer_strap` gets used
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.notify("Installing Lazy plugin manager, please wait...")
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"--single-branch",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.runtimepath:prepend(lazypath)
|
||||
|
||||
local lazy = require("lazy")
|
||||
|
||||
lazy.setup({
|
||||
-- Lazy itself
|
||||
{ "folke/lazy.nvim" },
|
||||
-- Commonly used library
|
||||
{
|
||||
"nvim-lua/plenary.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Much nicer ui, integrates cmdheight = 0 wella
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
config = function()
|
||||
-- NOTE: Might be redundant, to check later
|
||||
require("plugins.configs.nvim-notify")
|
||||
require("plugins.configs.noice")
|
||||
end,
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
},
|
||||
|
||||
-- Color schemes
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
build = function()
|
||||
require("plugins.configs.kanagawa")
|
||||
vim.cmd.KanagawaCompile()
|
||||
end,
|
||||
config = function()
|
||||
require("plugins.configs.kanagawa")
|
||||
vim.cmd.colorscheme("kanagawa")
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "lua/plugins/configs/kanagawa.lua",
|
||||
callback = function()
|
||||
vim.schedule(vim.cmd.KanagawaCompile)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Icons for folders, files, etc.
|
||||
{
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Statusline.
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.statusline")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Indentation Guides
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.indent-blankline")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = "VeryLazy",
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
{ url = "https://gitlab.com/HiPhish/nvim-ts-rainbow2.git" },
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.configs.treesitter")
|
||||
end,
|
||||
-- before = "folke/noice.nvim",
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
event = "VeryLazy",
|
||||
after = { "nvim-treesitter" },
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
disable = function(lang, bufnr)
|
||||
local mode = vim.fn.mode()
|
||||
if mode == "c" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
disable = function(lang, bufnr)
|
||||
local mode = vim.fn.mode()
|
||||
if mode == "c" then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]fs"] = "@function.outer",
|
||||
["]cs"] = "@class.outer",
|
||||
["]bs"] = "@block.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]fe"] = "@function.outer",
|
||||
["]ce"] = "@class.outer",
|
||||
["]be"] = "@block.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[fs"] = "@function.outer",
|
||||
["[cs"] = "@class.outer",
|
||||
["[bs"] = "@block.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[fe"] = "@function.outer",
|
||||
["[ce"] = "@class.outer",
|
||||
["[bs"] = "@block.outer",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Highlight given color codes
|
||||
{
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-highlight-colors").setup({
|
||||
enable_tailwind = true,
|
||||
render = "background",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Dashboard when no file is given to nvim
|
||||
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||
config = function()
|
||||
require("plugins.configs.alpha")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Telescope
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-media-files.nvim",
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
"artart222/telescope_find_directories",
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
"debugloop/telescope-undo.nvim",
|
||||
{ "nvim-telescope/telescope-smart-history.nvim", dependencies = "tami5/sqlite.lua" },
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
},
|
||||
config = function()
|
||||
require("plugins.configs.telescope-nvim")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- File Tree
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
event = "VeryLazy",
|
||||
branch = "v2.x",
|
||||
dependencies = {
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.configs.neotree")
|
||||
end,
|
||||
cmd = "Neotree",
|
||||
},
|
||||
|
||||
-- Lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"folke/neodev.nvim",
|
||||
"Decodetalkers/csharpls-extended-lsp.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"williamboman/mason.nvim",
|
||||
"simrat39/rust-tools.nvim",
|
||||
"Hoffs/omnisharp-extended-lsp.nvim",
|
||||
"b0o/schemastore.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup({})
|
||||
require("plugins.configs.lsp")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Show code actions
|
||||
{
|
||||
"kosayoda/nvim-lightbulb",
|
||||
after = "nvim-lspconfig",
|
||||
dependencies = {
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
},
|
||||
config = function()
|
||||
local text_icon = ""
|
||||
local nvim_lightbulb = require("nvim-lightbulb")
|
||||
nvim_lightbulb.setup({
|
||||
sign = {
|
||||
priority = 9
|
||||
},
|
||||
})
|
||||
vim.fn.sign_define( "LightBulbSign", { text = text_icon, numhl = "DiagnosticSignHint", texthl = "DiagnosticSignHint", priority = 9 })
|
||||
vim.api.nvim_create_autocmd("CursorHold,CursorHoldI", {
|
||||
callback = nvim_lightbulb.update_lightbulb
|
||||
})
|
||||
|
||||
end,
|
||||
},
|
||||
|
||||
-- Incremental rename, easier to view renames
|
||||
{
|
||||
"smjonas/inc-rename.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("inc_rename").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Better LSP Virtual Text Lines
|
||||
{
|
||||
url = "https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("lsp_lines").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Lsp From Null LS
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.null_ls")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Autopairs
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Snippets
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
dependencies = {
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
},
|
||||
after = "LuaSnip",
|
||||
},
|
||||
|
||||
-- Code completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-emoji",
|
||||
"hrsh7th/cmp-nvim-lsp-document-symbol",
|
||||
"hrsh7th/cmp-calc",
|
||||
"davidsierradz/cmp-conventionalcommits",
|
||||
"tamago324/cmp-zsh",
|
||||
"dmitmel/cmp-cmdline-history",
|
||||
"David-Kunz/cmp-npm",
|
||||
"lukas-reineke/cmp-rg",
|
||||
"onsails/lspkind.nvim",
|
||||
"f3fora/cmp-spell",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.configs._cmp")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"tzachar/cmp-fuzzy-buffer",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" },
|
||||
},
|
||||
{ "tzachar/cmp-fuzzy-path", dependencies = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },
|
||||
{
|
||||
"saecki/crates.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { { "nvim-lua/plenary.nvim" } },
|
||||
config = function()
|
||||
require("crates").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- DAP, debugger
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("dap.ext.vscode").load_launchjs()
|
||||
require("plugins.configs._dap")
|
||||
end,
|
||||
after = "nvim-notify",
|
||||
},
|
||||
|
||||
-- Python debugger, dapinstall does not play nice with debugpy
|
||||
{
|
||||
"mfussenegger/nvim-dap-python",
|
||||
event = "VeryLazy",
|
||||
after = "nvim-dap",
|
||||
config = function()
|
||||
require("plugins.configs.python-dap")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Virtual Text for DAP
|
||||
{
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
event = "VeryLazy",
|
||||
after = "nvim-dap",
|
||||
config = function()
|
||||
require("nvim-dap-virtual-text").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Fancy ui for dap
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
event = "VeryLazy",
|
||||
after = "nvim-dap",
|
||||
config = function()
|
||||
require("plugins.configs.dap-ui")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Code formatting
|
||||
{
|
||||
"sbdchd/neoformat",
|
||||
event = "VeryLazy",
|
||||
cmd = "Neoformat",
|
||||
config = function()
|
||||
require("plugins.configs.neoformat")
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"luukvbaal/statuscol.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
local builtin = require("statuscol.builtin")
|
||||
require("statuscol").setup({
|
||||
foldfunc = "builtin",
|
||||
setopt = true,
|
||||
relculright = false,
|
||||
segments = {
|
||||
{ text = { "%s" }, click = "v:lua.ScSa" },
|
||||
{ text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
|
||||
{ text = { " ", builtin.foldfunc, " " }, click = "v:lua.ScFa" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"kevinhwang91/nvim-ufo",
|
||||
dependencies = {
|
||||
"kevinhwang91/promise-async",
|
||||
},
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.nvim-ufo")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Git signs
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true,
|
||||
current_line_blame_opts = {
|
||||
delay = 0,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Highlight certain comments, TODO, BUG, etc.
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Show possible key bindings during typing
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Create full path if not existing on write
|
||||
{
|
||||
"jghauser/mkdir.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mkdir")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Text commenting
|
||||
{
|
||||
"terrortylor/nvim-comment",
|
||||
event = "VeryLazy",
|
||||
cmd = "CommentToggle",
|
||||
config = function()
|
||||
require("nvim_comment").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Move selections with alt+movement key
|
||||
{
|
||||
"matze/vim-move",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Register support in telescope with persistent save
|
||||
{
|
||||
"AckslD/nvim-neoclip.lua",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "tami5/sqlite.lua", module = "sqlite" },
|
||||
{ "nvim-telescope/telescope.nvim" },
|
||||
},
|
||||
config = function()
|
||||
require("neoclip").setup({
|
||||
enable_persistent_history = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Markdown Previewer
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
event = "VeryLazy",
|
||||
build = "cd app && npm install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
vim.g.mkdp_browser = "firefox-developer-edition"
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
|
||||
-- Better Git integration
|
||||
{
|
||||
"TimUntersberger/neogit",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("neogit").setup({
|
||||
disable_commit_confirmation = true,
|
||||
integrations = {
|
||||
diffview = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"sindrets/diffview.nvim",
|
||||
},
|
||||
},
|
||||
|
||||
-- Ansible Syntax Highlighting
|
||||
{
|
||||
"pearofducks/ansible-vim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Better search display
|
||||
{
|
||||
"kevinhwang91/nvim-hlslens",
|
||||
event = "VeryLazy",
|
||||
module = "hlslens",
|
||||
keys = "/",
|
||||
config = function()
|
||||
require("hlslens").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Note Taking
|
||||
{
|
||||
"nvim-neorg/neorg",
|
||||
build = ":Neorg sync-parsers",
|
||||
config = function()
|
||||
require("plugins.configs._neorg")
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-neorg/neorg-telescope",
|
||||
},
|
||||
after = "nvim-treesitter",
|
||||
ft = "norg",
|
||||
},
|
||||
|
||||
-- Log Syntax Highlighting
|
||||
{
|
||||
"MTDL9/vim-log-highlighting",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Lots of small modules pulled into
|
||||
-- one git repository
|
||||
{
|
||||
"echasnovski/mini.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("mini.cursorword").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Smoother Scrolling
|
||||
{
|
||||
"karb94/neoscroll.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("neoscroll").setup({
|
||||
easing_function = "circular",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Generate function/class/etc annotations
|
||||
{
|
||||
"danymat/neogen",
|
||||
event = "VeryLazy",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
config = function()
|
||||
require("neogen").setup({
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
cs = {
|
||||
template = {
|
||||
annotation_convention = "xmldoc",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Multiple cursor/multiple visual selection support
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
vim.cmd.VMTheme("codedark")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Maintain last cursor position in files
|
||||
{
|
||||
"ethanholz/nvim-lastplace",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-lastplace").setup({
|
||||
lastplace_ignore_buftype = { "quickfix", "nofile", "help" },
|
||||
lastplace_ignore_filetype = { "gitcommit", "gitrebase", "svn", "hgcommit", "fugitive" },
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Diagnose startup time
|
||||
{ "dstein64/vim-startuptime" },
|
||||
|
||||
-- More codeactions
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-treesitter/nvim-treesitter" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Http Request Support
|
||||
{
|
||||
"rest-nvim/rest.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
config = function()
|
||||
local rest_nvim = require("rest-nvim")
|
||||
rest_nvim.setup({
|
||||
-- This is a dev plugin, makes life easier
|
||||
skip_ssl_verification = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Allows repeating actions and more
|
||||
{
|
||||
"anuvyklack/hydra.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"anuvyklack/keymap-layer.nvim",
|
||||
"lewis6991/gitsigns.nvim",
|
||||
"jbyuki/venn.nvim",
|
||||
"folke/which-key.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("plugins.configs.hydra")
|
||||
end,
|
||||
},
|
||||
|
||||
-- Faster motions
|
||||
{
|
||||
"phaazon/hop.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
-- you can configure Hop the way you like here; see :h hop-config
|
||||
require("hop").setup({ keys = "etovxqpdygfblzhckisuran" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Surround actions
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Better list continuation
|
||||
{
|
||||
"gaoDean/autolist.nvim",
|
||||
event = "VeryLazy",
|
||||
ft = {
|
||||
"markdown",
|
||||
"text",
|
||||
"text",
|
||||
"plaintex",
|
||||
},
|
||||
config = function()
|
||||
require("autolist").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Tint inactive windows
|
||||
{
|
||||
"levouh/tint.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("tint").setup({
|
||||
highlight_ignore_patterns = {
|
||||
"WinSeparator",
|
||||
},
|
||||
window_ignore_function = function(winid)
|
||||
local bufid = vim.api.nvim_win_get_buf(winid)
|
||||
|
||||
local ignoredFiletypes = { "DiffviewFiles", "DiffviewFileHistory", "neo-tree" }
|
||||
local ignoredBuftypes = { "terminal" }
|
||||
|
||||
local isDiff = vim.api.nvim_win_get_option(winid, "diff")
|
||||
local isFloating = vim.api.nvim_win_get_config(winid).relative ~= ""
|
||||
local isIgnoredBuftype =
|
||||
vim.tbl_contains(ignoredBuftypes, vim.api.nvim_buf_get_option(bufid, "buftype"))
|
||||
local isIgnoredFiletype =
|
||||
vim.tbl_contains(ignoredFiletypes, vim.api.nvim_buf_get_option(bufid, "filetype"))
|
||||
|
||||
return isDiff or isFloating or isIgnoredBuftype or isIgnoredFiletype
|
||||
end,
|
||||
tint = -30,
|
||||
saturation = 0.8,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Highlight argument definitions and usages
|
||||
{
|
||||
"m-demare/hlargs.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
config = function()
|
||||
require("hlargs").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Vim Latex Support
|
||||
{
|
||||
"lervag/vimtex",
|
||||
event = "VeryLazy",
|
||||
ft = "tex",
|
||||
config = function()
|
||||
vim.g.vimtext_view_method = "zathura"
|
||||
vim.g.vimtex_view_general_viewer = "zathura"
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("toggleterm").setup({
|
||||
start_in_insert = false,
|
||||
direction = "float",
|
||||
autochdir = true,
|
||||
winbar = {
|
||||
enable = true,
|
||||
name_formatter = function(term) -- term: Terminal
|
||||
return term.name
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
cmd = {
|
||||
"ToggleTerm",
|
||||
"ToggleTermSetName",
|
||||
"ToggleTermToggleAll",
|
||||
"ToggleTermSendCurrentLine",
|
||||
"ToggleTermSendVisualLines",
|
||||
"ToggleTermSendVisualSelection",
|
||||
},
|
||||
},
|
||||
|
||||
-- Take a screenshot of code selected
|
||||
-- {
|
||||
-- "krivahtoo/silicon.nvim",
|
||||
-- build = "./install.sh build",
|
||||
-- event = "VeryLazy",
|
||||
-- dependencies = {
|
||||
-- "kyazdani42/nvim-web-devicons",
|
||||
-- },
|
||||
-- config = function()
|
||||
-- require("silicon").setup({
|
||||
-- font = "FiraCode Nerd Font=20",
|
||||
-- theme = "Monokai Extended",
|
||||
-- background = "#87F",
|
||||
-- pad_vert = 60,
|
||||
-- pad_horiz = 40,
|
||||
-- line_number = true,
|
||||
-- gobble = true,
|
||||
-- window_title = function()
|
||||
-- local devicons = require("nvim-web-devicons")
|
||||
-- local icon = devicons.get_icon_by_filetype(vim.bo.filetype)
|
||||
-- return icon .. " " .. vim.fn.fnamemodify(vim.fn.bufname(vim.fn.bufnr()), ":~:.")
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- Nice sidebar cursor goodies
|
||||
{
|
||||
"gen740/SmoothCursor.nvim",
|
||||
event = "VeryLazy",
|
||||
after = "kanagawa.nvim",
|
||||
config = function()
|
||||
require("smoothcursor").setup({
|
||||
priority = 8,
|
||||
fancy = {
|
||||
enable = true,
|
||||
head = { cursor = "⯈", texthl = "SmoothCursorCursor", linehl = nil },
|
||||
body = {
|
||||
{ cursor = "", texthl = "SmoothCursorTrailBig1" },
|
||||
{ cursor = "", texthl = "SmoothCursorTrailBig2" },
|
||||
{ cursor = "●", texthl = "SmoothCursorTrailMedium" },
|
||||
{ cursor = "●", texthl = "SmoothCursorTrailMedium" },
|
||||
{ cursor = "•", texthl = "SmoothCursorTrailSmall" },
|
||||
{ cursor = ".", texthl = "SmoothCursorTrailXSmall" },
|
||||
{ cursor = ".", texthl = "SmoothCursorTrailXSmall" },
|
||||
},
|
||||
},
|
||||
disabled_filetypes = { "NeogitNotification" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Color Picker
|
||||
{
|
||||
"uga-rosa/ccc.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("plugins.configs.ccc")
|
||||
end,
|
||||
cmd = {
|
||||
"CccPick",
|
||||
"CccConvert",
|
||||
"CccHighlighterEnable",
|
||||
"CccHighlighterToggle",
|
||||
"CccHighlighterDisable",
|
||||
},
|
||||
},
|
||||
|
||||
-- Task runner & job management
|
||||
{
|
||||
"stevearc/overseer.nvim",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("overseer").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- Better buffer deletion
|
||||
{
|
||||
"famiu/bufdelete.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Improved Visuals for Documentation
|
||||
{
|
||||
"lukas-reineke/headlines.nvim",
|
||||
event = "VeryLazy",
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
"skosulor/nibbler",
|
||||
config = function()
|
||||
require("nibbler").setup({
|
||||
display_enabled = true, -- Set to false to disable real-time display (default: true)
|
||||
})
|
||||
end,
|
||||
},
|
||||
}, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
concurrency = 20,
|
||||
},
|
||||
lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json",
|
||||
})
|
4
dots/.config/nvim/lua/plugins/postload.lua
Executable file
4
dots/.config/nvim/lua/plugins/postload.lua
Executable file
@ -0,0 +1,4 @@
|
||||
-- Anything that needs to be loaded LAST
|
||||
-- needs to required here
|
||||
require("plugins.mappings")
|
||||
require("plugins.autocmds")
|
43
dots/.config/nvim/lua/utils/funcs.lua
Executable file
43
dots/.config/nvim/lua/utils/funcs.lua
Executable file
@ -0,0 +1,43 @@
|
||||
local U = {}
|
||||
|
||||
U.rgbToHex = function(rgb)
|
||||
return string.format("#%06x", rgb)
|
||||
end
|
||||
|
||||
U.hexToRgb = function(hex_str)
|
||||
local hex = "[abcdef0-9][abcdef0-9]"
|
||||
local pat = "^#(" .. hex .. ")(" .. hex .. ")(" .. hex .. ")$"
|
||||
hex_str = string.lower(hex_str)
|
||||
|
||||
assert(string.find(hex_str, pat) ~= nil, "hex_to_rgb: invalid hex_str: " .. tostring(hex_str))
|
||||
|
||||
local r, g, b = string.match(hex_str, pat)
|
||||
return { tonumber(r, 16), tonumber(g, 16), tonumber(b, 16) }
|
||||
end
|
||||
|
||||
U.blend = function(fg, bg, alpha)
|
||||
bg = U.hexToRgb(bg)
|
||||
fg = U.hexToRgb(fg)
|
||||
|
||||
local blendChannel = function(i)
|
||||
local ret = (alpha * fg[i] + ((1 - alpha) * bg[i]))
|
||||
return math.floor(math.min(math.max(0, ret), 255) + 0.5)
|
||||
end
|
||||
|
||||
return string.format("#%02X%02X%02X", blendChannel(1), blendChannel(2), blendChannel(3))
|
||||
end
|
||||
|
||||
U.darken = function(hex, amount, bg)
|
||||
return U.blend(hex, bg or "#000000", math.abs(amount))
|
||||
end
|
||||
|
||||
U.lighten = function(hex, amount, fg)
|
||||
return U.blend(hex, fg or "#ffffff", math.abs(amount))
|
||||
end
|
||||
|
||||
U.get_color = function(group, attr)
|
||||
local fn = vim.fn
|
||||
return fn.synIDattr(fn.synIDtrans(fn.hlID(group)), attr)
|
||||
end
|
||||
|
||||
return U
|
226
dots/.config/nvim/spell/en.utf-8.add
Normal file
226
dots/.config/nvim/spell/en.utf-8.add
Normal file
@ -0,0 +1,226 @@
|
||||
metalpoint
|
||||
rotoscope
|
||||
Vassari
|
||||
Giorgio
|
||||
Kathe
|
||||
Kollwitz's
|
||||
volumetric
|
||||
gumwater
|
||||
Vergine
|
||||
delle
|
||||
Rocce
|
||||
Conte
|
||||
Vija
|
||||
Celmin's
|
||||
photorealistic
|
||||
unmoving
|
||||
Vinci's
|
||||
da
|
||||
Oilstick
|
||||
Dubuffet's
|
||||
Elisabetta
|
||||
Sirani
|
||||
de
|
||||
Mattise
|
||||
redrawings
|
||||
Eckstein's
|
||||
Kentridge
|
||||
Spiegelman's
|
||||
Maus
|
||||
Marjane
|
||||
Satrapi
|
||||
limewater
|
||||
Faiyum
|
||||
secco
|
||||
buon
|
||||
Pozzo
|
||||
Fra
|
||||
Scrovegni
|
||||
Bodhisattiva
|
||||
Giornata
|
||||
Encaustic
|
||||
Gesso
|
||||
arabic
|
||||
Photomontage
|
||||
photomontage
|
||||
Linocut
|
||||
linocut
|
||||
burin
|
||||
Drypoint
|
||||
Mezzotint
|
||||
drypoint
|
||||
planographic
|
||||
obscura
|
||||
Afocal
|
||||
Grande
|
||||
Jatte
|
||||
Gogh
|
||||
Pollick
|
||||
Gogh's
|
||||
fauv
|
||||
dimensionality
|
||||
Paleomagnetism
|
||||
geosphere
|
||||
lithospheric
|
||||
Asthenosphere
|
||||
upwarping
|
||||
Subduction
|
||||
subduct
|
||||
supercontinent
|
||||
and and
|
||||
across
|
||||
overlayed
|
||||
Mathic
|
||||
Cirum
|
||||
Benioff
|
||||
subducts
|
||||
subduction
|
||||
Orogenic
|
||||
basalts
|
||||
middleware
|
||||
Informal
|
||||
Latrinalia
|
||||
AMU
|
||||
Covalent
|
||||
3D
|
||||
Nonvariable
|
||||
powderized
|
||||
Anhedral
|
||||
Euhedral
|
||||
Octahedral
|
||||
Dodecahedral
|
||||
Moh's
|
||||
SiO4
|
||||
tetrahedra
|
||||
Ferromagnesian
|
||||
Nonferromagnesian
|
||||
SiOX
|
||||
Feldspars
|
||||
Plagioclase
|
||||
Liquidus
|
||||
Geotherm
|
||||
Ultramafic
|
||||
SiO2
|
||||
Mafic
|
||||
ultramafic
|
||||
mafic
|
||||
volatiles
|
||||
felsic
|
||||
Microcrystalline
|
||||
Lavas
|
||||
Aphanitic
|
||||
Macrocrystalline
|
||||
Phaneritic
|
||||
phaneritic
|
||||
pyroclastics
|
||||
aphanitic
|
||||
microcrystalline
|
||||
fragements
|
||||
volcanism
|
||||
Pyroclastic
|
||||
clasts
|
||||
plagioclase
|
||||
Pyroxene
|
||||
Olivine
|
||||
magmatic
|
||||
Fragmental
|
||||
OxyContin
|
||||
bads
|
||||
Sackler
|
||||
Pharma
|
||||
Opioid
|
||||
Sri
|
||||
opioid
|
||||
Stratovolcano
|
||||
Lahars
|
||||
Hydrothermal
|
||||
Gabbros
|
||||
Stratovolcanoes
|
||||
Circumpacific
|
||||
magmas
|
||||
CO3
|
||||
Halides
|
||||
SO4
|
||||
reproducibility
|
||||
Whitworth
|
||||
manufactories
|
||||
nanometer
|
||||
foundational
|
||||
Regolith
|
||||
Alfisol
|
||||
Aridisol
|
||||
Oxisol
|
||||
Detrital
|
||||
cementation
|
||||
Fossiliferous
|
||||
Arkos
|
||||
Breccia
|
||||
Siltstone
|
||||
Mudstones
|
||||
Travertine
|
||||
Speleothems
|
||||
Carbonic
|
||||
Calcilate
|
||||
Micrite
|
||||
Turbidite
|
||||
Turbidites
|
||||
Uniformitarianism
|
||||
Protolith
|
||||
Recrystallization
|
||||
unmetamorphosed
|
||||
pre-existing
|
||||
Contractionary
|
||||
citizenry
|
||||
Bretton
|
||||
stimulations
|
||||
soley
|
||||
Hoovervilles
|
||||
Samhain
|
||||
Lithostatic
|
||||
Lithification
|
||||
Diagenesis
|
||||
pluton
|
||||
nonfoliated
|
||||
foliated
|
||||
Phyllite
|
||||
Slaty
|
||||
Quartzite
|
||||
Dynamothermal
|
||||
subducting
|
||||
Chemosynthesis
|
||||
Chemosynthesisizing
|
||||
soundstage
|
||||
Backlighting
|
||||
Noir
|
||||
Mise
|
||||
Freytag's
|
||||
Biostratigraphic
|
||||
Lithologic
|
||||
Stratigraphic
|
||||
if
|
||||
biostratigraphic
|
||||
Carbonization
|
||||
Petrification
|
||||
Mineralization
|
||||
mineralized
|
||||
unconformity
|
||||
Disconformity
|
||||
Unconformities
|
||||
tectonically
|
||||
Paleogeography
|
||||
orogenic
|
||||
erosional
|
||||
Gondwana
|
||||
Orogenies
|
||||
Ouachita
|
||||
Alleghenian
|
||||
Baltica
|
||||
Laurentia
|
||||
Orogeny
|
||||
Acadian
|
||||
Avalonia
|
||||
Taconic
|
||||
Paleo
|
||||
Panthalassic
|
||||
Epeiric
|
||||
Craton
|
BIN
dots/.config/nvim/spell/en.utf-8.add.spl
Normal file
BIN
dots/.config/nvim/spell/en.utf-8.add.spl
Normal file
Binary file not shown.
626
dots/.config/nvim/syntax/cf3.vim
Normal file
626
dots/.config/nvim/syntax/cf3.vim
Normal file
@ -0,0 +1,626 @@
|
||||
" vim:foldmethod=marker
|
||||
|
||||
" Vim syntax file
|
||||
" Language: Cfengine version 3
|
||||
" Maintainer: Neil Watson <neil@watson-wilson.ca>
|
||||
" Last Change: Jun 02 2018
|
||||
" Location:
|
||||
"
|
||||
" TODO:
|
||||
" - would be great to know current promise type
|
||||
"
|
||||
" This is my first attempt at a syntax file. Feel free to send me corrections
|
||||
" or improvements. I'll give you a credit.
|
||||
"
|
||||
" USAGE
|
||||
" There is already a vim file that uses 'cf' as a file extension. You can use
|
||||
" cf3 for your cf3 file extensions or identify via your vimrc file:
|
||||
" au BufRead,BufNewFile *.cf set ft=cf3
|
||||
"
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
|
||||
if version < 600 " {{{
|
||||
syntax clear
|
||||
elseif exists ("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn match cf3BundleParams /(\w\+\(,\s*\w\+\)*)/hs=s+1,he=e-1 contained
|
||||
syn match cf3BundleName /\s\+\w\+\s*/ contained nextgroup=cf3BundleParams
|
||||
|
||||
syn keyword cf3BundleTypes agent common server knowledge monitor edit_line contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BundleTypes edit_xml contained nextgroup=cf3BundleName skipwhite
|
||||
syn match cf3Bundle /^\s*bundle\s\+/ nextgroup=Cf3BundleTypes skipwhite
|
||||
|
||||
syn keyword cf3BodyTypes action classes contain acl changes contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes copy_from delete depth_search contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes edit_defaults file_select password contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes link_from perms rename tcp_ip contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes package_method process_count package_module contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes process_select service_method contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes mount volume printfile match_value contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes association select_region delete_select contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes insert_select location edit_field replace_with contained nextgroup=cf3BundleName skipwhite
|
||||
syn keyword cf3BodyTypes common database_server environment_resources contained nextgroup=cf3BundleName skipwhite
|
||||
syn match cf3Body /^\s*body\s\+/ nextgroup=Cf3BodyTypes skipwhite
|
||||
|
||||
syn match cf3BodyControl /^\s*body\s\+\(common\|agent\|server\)\s\+control/
|
||||
syn match cf3BodyControl /^\s*body\s\+\(monitor\|runagent\)\s\+control/
|
||||
syn match cf3BodyControl /^\s*body\s\+\(executor\|knowledge\|hub\)\s\+control/
|
||||
syn match cf3BodyControl /^\s*body\s\+\(reporter\|file\)\s\+control/
|
||||
|
||||
syn match cf3Action /\<\(vars\|classes\|reports\|meta\|users\):/
|
||||
syn match cf3Action /\<\(commands\|databases\|files\|interfaces\|methods\|packages\|storage\):/
|
||||
syn match cf3Action /\<\(access\|measurements\|roles\|topics\|occurrences\|defaults\):/
|
||||
syn match cf3Action /\<\(control\|guest_environments\|outputs\|processes\|services\|things\):/
|
||||
syn match cf3Action /\<\(delete_lines\|field_edits\|insert_lines\|replace_patterns\):/
|
||||
|
||||
syn match cf3Class /[^ "\t:#]\+::/
|
||||
syn region cf3ClassBlock start=/\[%CFEngine/ end=/%\]/ contains=Cf3Class
|
||||
|
||||
syn keyword TODO todo TODO FIXME TBD NOTE contained
|
||||
syn match cf3Comment /#.*/ contains=TODO
|
||||
|
||||
syn match cf3Identifier /=>/
|
||||
|
||||
" Escape sequences in regexes
|
||||
syn match cf3Esc /\\\\[sSdD+][\+\*]*/ contained
|
||||
" Array indexes contained in []. Does not seems to be working.
|
||||
syn region cf3Array start=/\(\\\)\@<!\[/ end=/\]/ contained contains=cf3Var
|
||||
" Variables wrapped in {} or ()
|
||||
syn region cf3Var start=/[$@][{(]/ end=/[})]/ contains=cf3Var,cf3Array
|
||||
syn region cf3String start=/\z\("\|'\)/ skip=/\(\\\)\@<!\(\\\\\)*\\\z1/ end=/\z1/ contains=cf3Var,cf3Esc,cf3Array
|
||||
|
||||
syn keyword cf3Type string int real slist ilist rlist data
|
||||
|
||||
" The following list may be automatically generated using
|
||||
" tools/extract_cf3BuiltIns.sh
|
||||
|
||||
" Last update: 2018/06/02 - git tag 0d9d2ce30b91cb0a3d09d2b8b517b39e876dc7f3
|
||||
|
||||
syn keyword cf3BuiltIns access accessedbefore accumulated active_directory additional-resources contained
|
||||
syn keyword cf3BuiltIns adjusting-schedules adopting-cfengine agility ago alerts-custom-actions alerts-notifications contained
|
||||
syn keyword cf3BuiltIns all-types and application-management architecture-design augments authoring-policy-tools-and-workflow contained
|
||||
syn keyword cf3BuiltIns backup-and-restore basic-file-directory best-practices bodies browsing-host-information build-deploy-manage-audit contained
|
||||
syn keyword cf3BuiltIns bundles bundles-best-practices bundlesmatching bundlestate callstack_callers callstack_promisers contained
|
||||
syn keyword cf3BuiltIns canonify canonifyuniquely cf-agent cfe_internal cfe_internal-CFE_cfengine cfe_internal-core contained
|
||||
syn keyword cf3BuiltIns cfe_internal-enterprise cfe_internal-update cfe_internal-update-cfe_internal_dc_workflow cfe_internal-update-cfe_internal_local_git_remote cfe_internal-update-cfe_internal_update_from_repository cfe_internal-update-lib contained
|
||||
syn keyword cf3BuiltIns cfe_internal-update-systemd_units cfe_internal-update-update_bins cfe_internal-update-update_policy cfe_internal-update-update_processes cfengine-administration cf-execd contained
|
||||
syn keyword cf3BuiltIns cf-hub cf-key cf-monitord cf-net cf-promises cf-runagent contained
|
||||
syn keyword cf3BuiltIns cf-serverd changedbefore changelog-core changelog-enterprise changelog-masterfiles-policy-framework change-management contained
|
||||
syn keyword cf3BuiltIns changes changes-api-usage cheatsheet checking-status classes classes contained
|
||||
syn keyword cf3BuiltIns classesmatching classify classmatch cloud-computing command-line-reports commands contained
|
||||
syn keyword cf3BuiltIns commands-scripts-execution common-attributes-include common-body-attributes-include common_next_steps components concat contained
|
||||
syn keyword cf3BuiltIns connection const content-driven-policy controlling-frequency controls controls-cf_agent contained
|
||||
syn keyword cf3BuiltIns controls-cf_execd controls-cf-hub controls-cf_monitord controls-cf_runagent controls-cf_serverd controls-def contained
|
||||
syn keyword cf3BuiltIns controls-def_inputs controls-reports controls-update_def controls-update_def_inputs countclassesmatching countlinesmatching contained
|
||||
syn keyword cf3BuiltIns custom-https-certificate custom_inventory custom-ldap-port custom-ldaps-certificate database databases contained
|
||||
syn keyword cf3BuiltIns data_expand data_readstringarray data_readstringarrayidx data_regextract datastate data_sysctlvalues contained
|
||||
syn keyword cf3BuiltIns debugging-mission-portal def defaults delete_lines devops difference contained
|
||||
syn keyword cf3BuiltIns directory-structure dirname diskfree distributed-scheduling distribute-files-from-a-central-location edit contained
|
||||
syn keyword cf3BuiltIns edit_line edit_xml enable-plain-http enterprise enterprise-api enterprise-api-examples contained
|
||||
syn keyword cf3BuiltIns enterprise-api-ref enterprise-cfengine-guide enterprise-license enterprise-report-collection enterprise-report-filtering escape contained
|
||||
syn keyword cf3BuiltIns eval every example_aborting_execution example_change_detection example_copy_single_files example_create_filedir contained
|
||||
syn keyword cf3BuiltIns example_diskfree example_edit_motd example_edit_name_resolution example_enable_service example_find_mac_addr example_install_package contained
|
||||
syn keyword cf3BuiltIns example_mount_nfs example_ntp example_process_kill example_process_restart examples example-snippets contained
|
||||
syn keyword cf3BuiltIns example_ssh_keys example_sudoers example_updating_from_central_hub execresult expandrange external_data contained
|
||||
syn keyword cf3BuiltIns faq fhs field_edits file_comparison file-content file_control_promises contained
|
||||
syn keyword cf3BuiltIns fileexists file_hash file_permissions files filesexist filesize contained
|
||||
syn keyword cf3BuiltIns filestat files-tutorial file-template filter findfiles findprocesses contained
|
||||
syn keyword cf3BuiltIns find-public-key-for-host-sha fix-trust-after-ip-change fix-undefined-body-error format functions general contained
|
||||
syn keyword cf3BuiltIns general-installation getclassmetatags getenv getfields getgid getindices contained
|
||||
syn keyword cf3BuiltIns getuid getuserinfo getusers getvalues getvariablemetatags glossary contained
|
||||
syn keyword cf3BuiltIns glossary grep groupexists guest_environments guide hash contained
|
||||
syn keyword cf3BuiltIns hashmatch hash_to_int hierarchies high-availability host host2ip contained
|
||||
syn keyword cf3BuiltIns hostinnetgroup hostrange hosts-health hostsseen hostswithclass hub_administration contained
|
||||
syn keyword cf3BuiltIns hubknowledge ifelse include-install-bootstrap-configure-summary index insert_lines installation-and-configuration contained
|
||||
syn keyword cf3BuiltIns installation-community installation-enterprise installation-enterprise-free installation-enterprise-free-aws-rhel installation-enterprise-generic-tarball installation-enterprise-vagrant contained
|
||||
syn keyword cf3BuiltIns installation-guide install-get-started intersection introduction inventory inventory contained
|
||||
syn keyword cf3BuiltIns inventory-any inventory-debian inventory-freebsd inventory-generic inventory-linux inventory-lsb contained
|
||||
syn keyword cf3BuiltIns inventory-macos inventory-os inventory-redhat inventory-suse inventory-windows ip2host contained
|
||||
syn keyword cf3BuiltIns iprange irange isdir isexecutable isgreaterthan isipinsubnet contained
|
||||
syn keyword cf3BuiltIns islessthan islink isnewerthan isplain isvariable iteration contained
|
||||
syn keyword cf3BuiltIns itil join json-yaml-support-in-cfengine known-issues language-concepts lastnode contained
|
||||
syn keyword cf3BuiltIns laterthan latest-release ldap-api ldaparray ldaplist ldapvalue contained
|
||||
syn keyword cf3BuiltIns learn legal length lib lib-autorun lib-bundles contained
|
||||
syn keyword cf3BuiltIns lib-cfe_internal lib-cfe_internal_hub lib-cfengine_enterprise_hub_ha lib-commands lib-common lib-databases contained
|
||||
syn keyword cf3BuiltIns lib-edit_xml lib-event lib-examples lib-feature lib-files lib-guest_environments contained
|
||||
syn keyword cf3BuiltIns lib-monitor lib-packages lib-paths lib-processes lib-reports lib-services contained
|
||||
syn keyword cf3BuiltIns lib-stdlib lib-storage lib-testing lib-users lib-vcs line_editing contained
|
||||
syn keyword cf3BuiltIns lookup-license-info loops lsdir macros makerule managing-settings contained
|
||||
syn keyword cf3BuiltIns managing-users-and-roles manual-execution maparray mapdata maplist masterfiles-policy-framework contained
|
||||
syn keyword cf3BuiltIns masterfiles_policy_framework_upgrade match max mean measurements mergedata contained
|
||||
syn keyword cf3BuiltIns meta methods min modularity mon monitoring contained
|
||||
syn keyword cf3BuiltIns monitoring-reporting mustache-templating namespaces network network_connections networking contained
|
||||
syn keyword cf3BuiltIns nfs_and_containers none normal-ordering not now nth contained
|
||||
syn keyword cf3BuiltIns on open-nebula or orchestration output-email package_bundles contained
|
||||
syn keyword cf3BuiltIns package_modules packages packages-deprecated packagesmatching packageupdatesmatching parseintarray contained
|
||||
syn keyword cf3BuiltIns parsejson parserealarray parsestringarray parsestringarrayidx parseyaml pattern-matching-and-referencing contained
|
||||
syn keyword cf3BuiltIns peerleader peerleaders peers policy-deployment policy-framework policy-layers-abstraction contained
|
||||
syn keyword cf3BuiltIns policy-style pre-installation-checklist processes processexists product promise-patterns contained
|
||||
syn keyword cf3BuiltIns promises promises promises-available-in-cfengine promise-types putty-quick-start-guide query contained
|
||||
syn keyword cf3BuiltIns randomint readcsv readdata readenvfile readfile readintarray contained
|
||||
syn keyword cf3BuiltIns readintlist readjson readrealarray readreallist readstringarray readstringarrayidx contained
|
||||
syn keyword cf3BuiltIns readstringlist readtcp readyaml reference regarray regcmp contained
|
||||
syn keyword cf3BuiltIns regenerate-self-signed-cert regex_replace regextract registryvalue regldap regline contained
|
||||
syn keyword cf3BuiltIns reglist reinstall remoteclassesmatching remotescalar replace_patterns reporting contained
|
||||
syn keyword cf3BuiltIns reporting reporting-architecture reporting_ui report_inventory_remediate_sec_vulnerabilities reports reset-admin-creds contained
|
||||
syn keyword cf3BuiltIns returnszero reverse roles rrange search secure-bootstrap contained
|
||||
syn keyword cf3BuiltIns security-overview selectservers services services services-autorun services-main contained
|
||||
syn keyword cf3BuiltIns settings show-classes-and-vars shuffle software-adminstration some sort contained
|
||||
syn keyword cf3BuiltIns special-topics special-variables splayclass splitstring sql-queries sql-queries-enterprise-api contained
|
||||
syn keyword cf3BuiltIns sql-schema status-settings stigs storage storejson strcmp contained
|
||||
syn keyword cf3BuiltIns strftime string_downcase string_head string_length string_mustache string_reverse contained
|
||||
syn keyword cf3BuiltIns string_split string_tail string_upcase sublist sum supported-platforms contained
|
||||
syn keyword cf3BuiltIns sys sysctlvalue system-administration system-file system-information system-security contained
|
||||
syn keyword cf3BuiltIns tags teamwork testing-policies this timing-counting-measuring translatepath contained
|
||||
syn keyword cf3BuiltIns tutorials unable-to-log-in-mission-portal uninstall-reinstall unique update upgrading contained
|
||||
syn keyword cf3BuiltIns url_get usemodule userexists user-interface user-management users contained
|
||||
syn keyword cf3BuiltIns users users-rbac variables variables variablesmatching variablesmatching_as_data contained
|
||||
syn keyword cf3BuiltIns variance vars version-control vi-quick-start-guide what-did-cfengine-change what-is-promise-locking contained
|
||||
syn keyword cf3BuiltIns whatsnew why-are-files-not-being-distributed why-are-remote-agents-not-updating windows-registry contained
|
||||
|
||||
" The following list may be automatically generated using
|
||||
" tools/extract_cf3evolve_freelib.sh
|
||||
|
||||
" Last update: 2018/06/02 - git tag d9d8bc814a70b64f5fb0fca0104f9802c4a7d88b
|
||||
|
||||
syn keyword cf3Evolve_freelib by_command by_command contain_efl_command contain_efl_command efl_command contained
|
||||
syn keyword cf3Evolve_freelib efl_command efl_copy_files efl_copy_files efl_cpf efl_cpf efl_delete_files contained
|
||||
syn keyword cf3Evolve_freelib efl_delete_files efl_delta_reporting efl_delta_reporting efl_disable_service efl_disable_service efl_dump_strings contained
|
||||
syn keyword cf3Evolve_freelib efl_dump_strings efl_edit_template efl_edit_template efl_empty efl_empty efl_enable_service contained
|
||||
syn keyword cf3Evolve_freelib efl_enable_service efl_file_perms efl_file_perms efl_kill_process efl_kill_process efl_kill_process contained
|
||||
syn keyword cf3Evolve_freelib efl_kill_process efl_lastseen efl_lastseen efl_link efl_link efl_mon_cfengine contained
|
||||
syn keyword cf3Evolve_freelib efl_mon_cfengine efl_notseen efl_notseen efl_packages efl_packages efl_packages_new contained
|
||||
syn keyword cf3Evolve_freelib efl_packages_new efl_packages_via_cmd efl_packages_via_cmd efl_process_count efl_process_count efl_rcs_pull contained
|
||||
syn keyword cf3Evolve_freelib efl_rcs_pull efl_recurse_and_exclude efl_recurse_and_exclude efl_rkn efl_rkn efl_server_csv contained
|
||||
syn keyword cf3Evolve_freelib efl_server_csv efl_server_json efl_server_json efl_service efl_service efl_service_recurse contained
|
||||
syn keyword cf3Evolve_freelib efl_service_recurse efl_source_type efl_source_type efl_start_service efl_start_service efl_sysctl_conf_file contained
|
||||
syn keyword cf3Evolve_freelib efl_sysctl_conf_file efl_sysctl_live efl_sysctl_live efl_test_classes efl_test_classes efl_test_count contained
|
||||
syn keyword cf3Evolve_freelib efl_test_count efl_test_vars efl_test_vars el_efl_sysctl_conf_file el_efl_sysctl_conf_file name_age_negate contained
|
||||
syn keyword cf3Evolve_freelib name_age_negate negate_by_name negate_by_name contained
|
||||
|
||||
" The following list may be automatically generated using
|
||||
" tools/extract_cf3Stdlib.sh
|
||||
|
||||
" Last update: 2018/06/02 - git tag 9ff3f394a2b0435549ce17e595edb295a92e53b7
|
||||
|
||||
syn keyword cf3Stdlib INI_section access_generic after all all_changes contained
|
||||
syn keyword cf3Stdlib alpinelinux always any_count append_groups_starting append_if_no_line append_if_no_lines contained
|
||||
syn keyword cf3Stdlib append_to_line_end append_user_field append_users_starting apt apt_get apt_get contained
|
||||
syn keyword cf3Stdlib apt_get_permissive apt_get_release autorun backup_local_cp backup_timestamp before contained
|
||||
syn keyword cf3Stdlib bg bigger_than bootstart brew bundles_common by_name contained
|
||||
syn keyword cf3Stdlib by_owner by_pid cat cf2_if_else cfe_internal_cleanup_agent_reports cfe_internal_common contained
|
||||
syn keyword cf3Stdlib cfe_internal_database_cleanup_consumer_status cfe_internal_database_cleanup_diagnostics cfe_internal_database_cleanup_promise_log cfe_internal_database_cleanup_reports cfe_internal_database_partitioning cfe_internal_hub_common contained
|
||||
syn keyword cf3Stdlib cfe_internal_hub_maintain cfe_internal_postgresql_maintenance cfe_internal_postgresql_vacuum cfengine_enterprise_hub_ha check_range classes_generic contained
|
||||
syn keyword cf3Stdlib classic_services cmd_repair cmerge col collect_vars comment contained
|
||||
syn keyword cf3Stdlib comment_lines_containing comment_lines_matching common_knowledge contains_literal_string control converge contained
|
||||
syn keyword cf3Stdlib copyfrom_sync create_solaris_admin_file cronjob daemonize darwin_knowledge days_old contained
|
||||
syn keyword cf3Stdlib days_older_than debian_knowledge delete_lines_matching detect_all_change detect_all_change_using detect_content contained
|
||||
syn keyword cf3Stdlib detect_content_using diff diff_noupdate diff_results dir_sync dirs contained
|
||||
syn keyword cf3Stdlib disable dpkg_version emerge empty enumerate event_cancel_events contained
|
||||
syn keyword cf3Stdlib event_debug_handler event_handle event_install_handler event_register event_usage_example ex_list contained
|
||||
syn keyword cf3Stdlib exclude exclude_procs expand_template feature feature_cancel feature_test contained
|
||||
syn keyword cf3Stdlib file_copy file_empty file_hardlink file_link file_make file_make_mog contained
|
||||
syn keyword cf3Stdlib file_make_mustache file_make_mustache_with_perms file_mustache file_mustache_jsonstring file_tidy fileinfo contained
|
||||
syn keyword cf3Stdlib files_common filetype_older_than filetypes_older_than force_deps freebsd freebsd_portmaster contained
|
||||
syn keyword cf3Stdlib freebsd_ports fstab_option_editor fstab_options generic git git_add contained
|
||||
syn keyword cf3Stdlib git_checkout git_checkout_new_branch git_clean git_commit git_init git_stash contained
|
||||
syn keyword cf3Stdlib git_stash_and_clean hashed_password head head_n if_elapsed if_elapsed_day contained
|
||||
syn keyword cf3Stdlib if_else if_notkept if_ok if_ok_cancel if_repaired ifwin_bg contained
|
||||
syn keyword cf3Stdlib immediate in_dir in_dir_shell in_dir_shell_and_silent in_shell in_shell_and_silent contained
|
||||
syn keyword cf3Stdlib in_shell_bg include_base insert_before_if_no_line insert_file insert_ini_section insert_lines contained
|
||||
syn keyword cf3Stdlib ips jail kept_successful_command kvm line line_match_value contained
|
||||
syn keyword cf3Stdlib lines_present linkchildren linkfrom ln_s local_cp local_dcp contained
|
||||
syn keyword cf3Stdlib local_mysql local_postgresql log_repaired log_verbose logrotate m contained
|
||||
syn keyword cf3Stdlib maintain_key_values manage_variable_values_ini measure_performance measure_promise_time min_free_space mo contained
|
||||
syn keyword cf3Stdlib mog msi_explicit msi_implicit name_age nfs nfs_p contained
|
||||
syn keyword cf3Stdlib nimclient no_backup no_backup_cp no_backup_dcp no_backup_rcp noupdate contained
|
||||
syn keyword cf3Stdlib npm npm_g npm_knowledge ntfs og older_than contained
|
||||
syn keyword cf3Stdlib opencsw owner package_absent package_latest package_module_knowledge package_present contained
|
||||
syn keyword cf3Stdlib package_specific package_specific_absent package_specific_latest package_specific_present packages_common pacman contained
|
||||
syn keyword cf3Stdlib paths perms_cp perms_dcp pip pip_knowledge pkg contained
|
||||
syn keyword cf3Stdlib pkgsrc plain plaintext_password policy prepend_if_no_line probabilistic_usebundle contained
|
||||
syn keyword cf3Stdlib process_kill prunedir prunetree quoted_var recurse recurse_ignore contained
|
||||
syn keyword cf3Stdlib recurse_with_base redhat_knowledge redhat_no_locking_knowledge regex_replace remote_cp remote_dcp contained
|
||||
syn keyword cf3Stdlib replace_line_end replace_or_add resolvconf resolvconf_o results rm_rf contained
|
||||
syn keyword cf3Stdlib rm_rf_depth rotate rpm_filebased rpm_knowledge rpm_version run_ifdefined contained
|
||||
syn keyword cf3Stdlib sample_rate scan_changing_file scan_log scoped_classes_generic secure_cp seed_cp contained
|
||||
syn keyword cf3Stdlib services_common set_colon_field set_config_values set_config_values_matching set_line_based set_quoted_values contained
|
||||
syn keyword cf3Stdlib set_user_field set_variable_values set_variable_values_ini setuid setuid_gid_umask setuid_sh contained
|
||||
syn keyword cf3Stdlib setuid_umask setuidgid_dir setuidgid_sh silent silent_in_dir single_value contained
|
||||
syn keyword cf3Stdlib size_range slackpkg smartos smartos_pkg_add solaris solaris_install contained
|
||||
syn keyword cf3Stdlib solaris_knowledge standard_services standard_services start state_repaired std_defs contained
|
||||
syn keyword cf3Stdlib stdlib_common strict suse_knowledge symlinked_to sync_cp system_owned contained
|
||||
syn keyword cf3Stdlib testing_generic_report testing_junit_report testing_ok testing_ok_if testing_skip testing_tap_bailout contained
|
||||
syn keyword cf3Stdlib testing_tap_report testing_todo testing_usage_example tidy to u_kept_successful_command contained
|
||||
syn keyword cf3Stdlib uncomment uncomment_lines_containing uncomment_lines_matching unmount url_ping value contained
|
||||
syn keyword cf3Stdlib vcs_common warn_lines_matching warn_only windows_feature xml_insert_tree xml_insert_tree_nopath contained
|
||||
syn keyword cf3Stdlib xml_set_attribute xml_set_value yum yum yum_group yum_rpm contained
|
||||
syn keyword cf3Stdlib yum_rpm_enable_repo yum_rpm_permissive zypper zypper contained
|
||||
|
||||
"syn match cf3Function /\w\+[,;(\>]/ contains=cf3BuiltIns,cf3Stdlib
|
||||
syn match cf3Function /\<\w\+[,;()]/ contains=cf3BuiltIns,cf3Stdlib,cf3Evolve_freelib
|
||||
|
||||
syn keyword cf3ControlAttr bundlesequence cache_system_functions goal_categories contained
|
||||
syn keyword cf3ControlAttr ignore_missing_bundles ignore_missing_inputs inputs contained
|
||||
syn keyword cf3ControlAttr version lastseenexpireafter output_prefix domain contained
|
||||
syn keyword cf3ControlAttr require_comments host_licenses_paid site_classes contained
|
||||
syn keyword cf3ControlAttr syslog_host syslog_port fips_mode protocol_version contained
|
||||
syn keyword cf3ControlAttr package_module contained
|
||||
syn keyword cf3MethodAttr usebundle useresult inherit contained
|
||||
syn keyword cf3CommonAttr action classes if unless ifvarclass handle depends_on comment policy with meta contained
|
||||
syn keyword cf3ClassesAttr and dist expression not or persistence scope select_class xor contained
|
||||
syn keyword cf3CommandsAttr args contain module contained
|
||||
syn keyword cf3ProcessesAttr process_count process_select contained
|
||||
syn keyword cf3ProcessesAttr process_stop restart_class signals contained
|
||||
syn keyword cf3PackagesAttr package_architectures package_method package_policy contained
|
||||
syn keyword cf3PackagesAttr package_select package_version package_module contained
|
||||
syn keyword cf3GuestEnvAttr environment_host environment_interface contained
|
||||
syn keyword cf3GuestEnvAttr environment_resources environment_state contained
|
||||
syn keyword cf3GuestEnvAttr environment_type contained
|
||||
syn keyword cf3TopicsAttr association synonyms generalizations contained
|
||||
syn keyword cf3ServicesAttr service_policy service_dependencies service_method contained
|
||||
syn keyword cf3DatabasesAttr database_server database_type contained
|
||||
syn keyword cf3DatabasesAttr database_operation database_columns contained
|
||||
syn keyword cf3DatabasesAttr database_rows registry_exclude contained
|
||||
syn keyword cf3DefaultsAttr if_match_regex contained
|
||||
syn keyword cf3StorageAttr mount volume contained
|
||||
syn keyword cf3FilesAttr acl changes copy_from create delete depth_search contained
|
||||
syn keyword cf3FilesAttr edit_defaults edit_line edit_template edit_xml file_select contained
|
||||
syn keyword cf3FilesAttr link_from move_obstructions pathtype perms contained
|
||||
syn keyword cf3FilesAttr rename repository template_method template_data touch transformer contained
|
||||
syn keyword cf3AccessAttr admit_ips admit_hostnames admit_keys admit deny deny_ips deny_hostnames deny_keys maproot contained
|
||||
syn keyword cf3AccessAttr ifencrypted resource_type contained
|
||||
syn keyword cf3MeasurementsAttr stream_type data_type history_type contained
|
||||
syn keyword cf3MeasurementsAttr units match_value contained
|
||||
syn keyword cf3ReportsAttr friend_pattern intermittency lastseen contained
|
||||
syn keyword cf3ReportsAttr printfile report_to_file showstate contained
|
||||
syn keyword cf3ReportsAttr bundle_return_value_index contained
|
||||
|
||||
" Bodies
|
||||
syn keyword cf3EditLineAttr replace_with edit_field whitespace_policy location contained
|
||||
syn keyword cf3EditLineAttr insert_select insert_type expand_scalars not_matching contained
|
||||
syn keyword cf3EditLineAttr delete_select select_region contained
|
||||
syn keyword cf3EditFieldAttr allow_blank_fields extend_fields field_operation contained
|
||||
syn keyword cf3EditFieldAttr field_separator field_value select_field contained
|
||||
syn keyword cf3EditFieldAttr start_fields_from_zero value_separator contained
|
||||
syn keyword cf3ReplaceWithAttr occurrences replace_value contained
|
||||
syn keyword cf3SelectRegionAttr include_start_delimiter include_end_delimiter contained
|
||||
syn keyword cf3SelectRegionAttr select_start select_end contained
|
||||
syn keyword cf3ProcCountAttr in_range_define match_range out_of_range_define contained
|
||||
syn keyword cf3ProcSelectAttr command pid ppid pgid priority process_owner contained
|
||||
syn keyword cf3ProcSelectAttr process_result rsize status stime_range ttime_range contained
|
||||
syn keyword cf3ProcSelectAttr tty threads vsize contained
|
||||
syn keyword cf3EditDefAttr edit_backup empty_file_before_editing max_file_size recognize_join contained
|
||||
syn keyword cf3LocationAttr before_after first_last select_line_matching contained
|
||||
syn keyword cf3BodyFileSelectAttr leaf_name path_name search_mode search_size search_owners contained
|
||||
syn keyword cf3BodyFileSelectAttr search_groups search_bsdflags ctime mtime atime contained
|
||||
syn keyword cf3BodyFileSelectAttr exec_regex exec_program file_types issymlinkto file_result contained
|
||||
syn keyword cf3BodyClassesAttr promise_repaired repair_failed repair_denied contained
|
||||
syn keyword cf3BodyClassesAttr repair_timeout promise_kept cancel_kept cancel_repaired contained
|
||||
syn keyword cf3BodyClassesAttr cancel_notkept kept_returncodes repaired_returncodes contained
|
||||
syn keyword cf3BodyClassesAttr failed_returncodes persist_time scope timer_policy contained
|
||||
syn keyword cf3BodyLinkFromAttr copy_patterns link_children link_type source contained
|
||||
syn keyword cf3BodyLinkFromAttr when_linking_children when_no_source contained
|
||||
syn keyword cf3BodyPermsAttr bsdflags groups mode owners rxdirs contained
|
||||
syn keyword cf3BodyACLAttr aces acl_directory_inherit acl_method acl_type specify_inherit_aces contained
|
||||
syn keyword cf3BodyDepthSearchAttr depth exclude_dirs include_basedir include_dirs contained
|
||||
syn keyword cf3BodyDepthSearchAttr rmdeadlinks traverse_links xdev contained
|
||||
syn keyword cf3BodyDeleteAttr dirlinks rmdirs contained
|
||||
syn keyword cf3BodyRenameAttr disable disable_mode disable_suffix newname rotate contained
|
||||
syn keyword cf3BodyChangesAttr hash report_changes update_hashes report_diffs contained
|
||||
syn keyword cf3BodyPackageModuleAttr default_options query_installed_ifelapsed contained
|
||||
syn keyword cf3BodyPackageModuleAttr query_updates_ifelapsed contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_add_command package_arch_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_changes package_delete_command contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_delete_convention package_file_repositories contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_installed_regex package_list_arch_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_list_command package_list_name_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_list_update_command package_list_update_ifelapsed contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_list_version_regex package_name_convention contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_name_regex package_noverify_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_noverify_returncode package_patch_arch_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_patch_command package_patch_installed_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_patch_list_command package_patch_name_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_patch_version_regex package_update_command contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_verify_command package_version_regex contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_version_less_command package_version_equal_command contained
|
||||
syn keyword cf3BodyPackageMethodAttr package_multiline_start contained
|
||||
syn keyword cf3BodyActionAttr action_policy ifelapsed expireafter log_string contained
|
||||
syn keyword cf3BodyActionAttr log_level log_kept log_priority log_repaired contained
|
||||
syn keyword cf3BodyActionAttr log_failed value_kept value_repaired value_notkept contained
|
||||
syn keyword cf3BodyActionAttr audit background report_level contained
|
||||
syn keyword cf3BodyActionAttr measurement_class contained
|
||||
syn keyword cf3BodyContainAttr useshell umask exec_owner exec_group exec_timeout contained
|
||||
syn keyword cf3BodyContainAttr chdir chroot preview no_output contained
|
||||
syn keyword cf3BodyCopyFromAttr source servers collapse_destination_dir contained
|
||||
syn keyword cf3BodyCopyFromAttr compare copy_backup encrypt check_root contained
|
||||
syn keyword cf3BodyCopyFromAttr copylink_patterns copy_size findertype contained
|
||||
syn keyword cf3BodyCopyFromAttr linkcopy_patterns link_type force_update contained
|
||||
syn keyword cf3BodyCopyFromAttr force_ipv4 portnumber preserve protocol_version purge contained
|
||||
syn keyword cf3BodyCopyFromAttr stealth timeout trustkey type_check verify contained
|
||||
syn keyword cf3BodyVolumeAttr check_foreign freespace sensible_size contained
|
||||
syn keyword cf3BodyVolumeAttr sensible_count scan_arrivals contained
|
||||
syn keyword cf3BodyMountAttr edit_fstab mount_type mount_source contained
|
||||
syn keyword cf3BodyMountAttr mount_server mount_options unmount contained
|
||||
syn keyword cf3BodyServiceMethodAttr service_type service_args contained
|
||||
syn keyword cf3BodyServiceMethodAttr service_autostart_policy service_dependence_chain contained
|
||||
syn keyword cf3BodyDatabaseServerAttr db_server_owner db_server_password contained
|
||||
syn keyword cf3BodyDatabaseServerAttr db_server_host db_server_type contained
|
||||
syn keyword cf3BodyDatabaseServerAttr db_server_connection_db contained
|
||||
syn keyword cf3BodyEnvResourcesAttr env_cpus env_memory env_disk contained
|
||||
syn keyword cf3BodyEnvResourcesAttr env_baseline env_spec_file env_spec contained
|
||||
syn keyword cf3BodyMatchValueAttr select_line_matching select_line_number contained
|
||||
syn keyword cf3BodyMatchValueAttr extraction_regex track_growing_file contained
|
||||
syn keyword cf3BodyServiceMethodAttr service_type service_args service_bundle contained
|
||||
syn keyword cf3BodyServiceMethodAttr service_autostart_policy service_dependence_chain contained
|
||||
syn keyword cf3BodyEnvInterfaceAttr env_addresses env_name env_network contained
|
||||
syn keyword cf3BodyServerControlAttr allowallconnects allowconnects allowlegacyconnects contained
|
||||
syn keyword cf3BodyServerControlAttr allowusers auditing bindtointerface contained
|
||||
syn keyword cf3BodyServerControlAttr cfruncommand denybadclocks denyconnects contained
|
||||
syn keyword cf3BodyServerControlAttr dynamicaddresses hostnamekeys keycacheTTL contained
|
||||
syn keyword cf3BodyServerControlAttr logallconnections logencryptedtransfers contained
|
||||
syn keyword cf3BodyServerControlAttr maxconnections port serverfacility contained
|
||||
syn keyword cf3BodyServerControlAttr skipverify trustkeysfrom contained
|
||||
syn keyword cf3BodyAgentControlAttr abortclasses abortbundleclasses addclasses contained
|
||||
syn keyword cf3BodyAgentControlAttr agentaccess agentfacility alwaysvalidate contained
|
||||
syn keyword cf3BodyAgentControlAttr auditing binarypaddingchar bindtointerface contained
|
||||
syn keyword cf3BodyAgentControlAttr hashupdates childlibpath checksum_alert_time contained
|
||||
syn keyword cf3BodyAgentControlAttr defaultcopytype dryrun editbinaryfilesize contained
|
||||
syn keyword cf3BodyAgentControlAttr editfilesize environment exclamation expireafter contained
|
||||
syn keyword cf3BodyAgentControlAttr files_single_copy files_auto_define hostnamekeys contained
|
||||
syn keyword cf3BodyAgentControlAttr ifelapsed inform intermittency max_children contained
|
||||
syn keyword cf3BodyAgentControlAttr maxconnections mountfilesystems nonalphanumfiles contained
|
||||
syn keyword cf3BodyAgentControlAttr repchar refresh_processes default_repository contained
|
||||
syn keyword cf3BodyAgentControlAttr secureinput sensiblecount sensiblesize contained
|
||||
syn keyword cf3BodyAgentControlAttr skipidentify suspiciousnames syslog verbose contained
|
||||
syn keyword cf3BodyAgentControlAttr track_value timezone default_timeout contained
|
||||
syn keyword cf3BodyExecutorControlAttr splaytime mailfrom mailsubject mailto smtpserver contained
|
||||
syn keyword cf3BodyExecutorControlAttr mailmaxlines schedule executorfacility contained
|
||||
syn keyword cf3BodyExecutorControlAttr exec_command contained
|
||||
syn keyword cf3BodyEditDefsAttr edit_backup empty_file_before_editing contained
|
||||
syn keyword cf3BodyEditDefsAttr max_file_size recognize_join inherit contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_startwith_from_list contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_not_startwith_from_list contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_match_from_list contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_not_match_from_list contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_contains_from_list contained
|
||||
syn keyword cf3BodyDeleteSelectAttr delete_if_not_contains_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_startwith_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_not_startwith_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_match_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_not_match_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_contains_from_list contained
|
||||
syn keyword cf3BodyInsertSelectAttr insert_if_not_contains_from_list contained
|
||||
syn keyword cf3BodyMonitorControlAttr forgetrate monitorfacility histograms contained
|
||||
syn keyword cf3BodyMonitorControlAttr tcpdump tcpdumpcommand contained
|
||||
syn keyword cf3BodyPrintfileAttr file_to_print number_of_lines contained
|
||||
|
||||
syn cluster cf3AttrCluster contains=cf3CommonAttr,cf3ClassesAttr,cf3Identifier,
|
||||
syn cluster cf3AttrCluster add=cf3ProcessesAttr,cf3FilesAttr,cf3ReportsAttr
|
||||
syn cluster cf3AttrCluster add=cf3PackagesAttr,cf3GuestEnvAttr,cf3TopicsAttr
|
||||
syn cluster cf3AttrCluster add=cf3StorageAttr,cf3AccessAttr,cf3MeasurementsAttr
|
||||
syn cluster cf3AttrCluster add=cf3EditLineAttr,cf3EditFieldAttr,cf3ReplaceWithAttr
|
||||
syn cluster cf3AttrCluster add=cf3SelectRegionAttr,cf3ProcCountAttr,cf3ProcSelectAttr
|
||||
syn cluster cf3AttrCluster add=cf3EditDefAttr,cf3LocationAttr,cf3CommandsAttr,cf3BodyFileSelectAttr
|
||||
syn cluster cf3AttrCluster add=cf3ControlAttr,cf3MethodAttr,cf3BodyClassesAttr
|
||||
syn cluster cf3AttrCluster add=cf3ServicesAttr,cf3DatabasesAttr,cf3DefaultsAttr
|
||||
|
||||
syn cluster cf3AttrCluster add=cf3BodyLinkFromAttr,cf3BodyPermsAttr,cf3BodyACLAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyDepthSearchAttr,cf3BodyDeleteAttr,cf3BodyRenameAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyChangesAttr,cf3BodyPackageMethodAttr,cf3BodyActionAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyPackageModuleAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyContainAttr,cf3BodyCopyFromAttr,cf3BodyVolumeAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyMountAttr,cf3BodyServiceMethodAttr,cf3BodyDatabaseServerAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyEnvResourcesAttr,cf3BodyMatchValueAttr,cf3BodyServiceMethodAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyEnvInterfaceAttr,cf3BodyServerControlAttr,cf3BodyEditDefsAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyAgentControlAttr,cf3BodyExecutorControlAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyDeleteSelectAttr,cf3BodyInsertSelectAttr
|
||||
syn cluster cf3AttrCluster add=cf3BodyMonitorControlAttr,cf3BodyPrintfileAttr
|
||||
syn match cf3Attributes /\w\+\s*=>/ contains=@cf3AttrCluster
|
||||
|
||||
" }}}
|
||||
|
||||
if version >= 508 || !exists("did_cfg_syn_inits") " {{{
|
||||
if version < 508
|
||||
let did_cfg_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
hi cf3Context ctermfg=DarkGreen
|
||||
hi cf3Arrows ctermfg=DarkCyan
|
||||
hi cf3Type ctermfg=Magenta
|
||||
hi Identifier ctermfg=Blue
|
||||
hi Function ctermfg=DarkGreen
|
||||
hi Library ctermfg=DarkGrey
|
||||
hi cf3ClassBlock ctermfg=Yellow
|
||||
|
||||
HiLink cf3Bundle Statement
|
||||
HiLink cf3BundleTypes Statement
|
||||
HiLink cf3BundleName Function
|
||||
HiLink cf3BundleParams Identifier
|
||||
|
||||
HiLink cf3Body Statement
|
||||
HiLink cf3BodyTypes Statement
|
||||
HiLink cf3Comment Comment
|
||||
|
||||
HiLink cf3BodyControl Statement
|
||||
HiLink cf3BodyControlTypes Statement
|
||||
HiLink cf3BodyControlName Statement
|
||||
|
||||
HiLink cf3Action Underlined
|
||||
HiLink cf3Class cf3Context
|
||||
|
||||
HiLink cf3String String
|
||||
HiLink cf3BuiltIns Function
|
||||
HiLink cf3Evolve_freelib Function
|
||||
HiLink cf3Stdlib Library
|
||||
|
||||
HiLink cf3Identifier cf3Arrows
|
||||
HiLink cf3Esc Special
|
||||
HiLink cf3Array Special
|
||||
HiLink cf3Var Identifier
|
||||
|
||||
HiLink cf3Type cf3Type
|
||||
HiLink cf3CommonAttr Statement
|
||||
HiLink cf3ClassesAttr Statement
|
||||
HiLink cf3CommandsAttr Statement
|
||||
HiLink cf3ProcessesAttr Statement
|
||||
HiLink cf3FilesAttr Statement
|
||||
HiLink cf3MethodAttr cf3Type
|
||||
HiLink cf3PackagesAttr Statement
|
||||
HiLink cf3ControlAttr Statement
|
||||
HiLink cf3GuestEnvAttr Statement
|
||||
HiLink cf3TopicsAttr Statement
|
||||
HiLink cf3ServicesAttr Statement
|
||||
HiLink cf3DatabasesAttr Statement
|
||||
HiLink cf3DefaultsAttr Statement
|
||||
HiLink cf3StorageAttr Statement
|
||||
HiLink cf3AccessAttr Statement
|
||||
HiLink cf3MeasurementsAttr Statement
|
||||
HiLink cf3ReportsAttr Statement
|
||||
|
||||
HiLink cf3EditLineAttr Statement
|
||||
HiLink cf3EditFieldAttr Statement
|
||||
HiLink cf3ReplaceWithAttr Statement
|
||||
HiLink cf3SelectRegionAttr Statement
|
||||
HiLink cf3ProcCountAttr Statement
|
||||
HiLink cf3ProcSelectAttr Statement
|
||||
HiLink cf3EditDefAttr Statement
|
||||
HiLink cf3LocationAttr Statement
|
||||
HiLink cf3BodyFileSelectAttr Statement
|
||||
HiLink cf3BodyClassesAttr Statement
|
||||
HiLink cf3BodyLinkFromAttr Statement
|
||||
HiLink cf3BodyPermsAttr Statement
|
||||
HiLink cf3BodyACLAttr Statement
|
||||
HiLink cf3BodyDepthSearchAttr Statement
|
||||
HiLink cf3BodyDeleteAttr Statement
|
||||
HiLink cf3BodyRenameAttr Statement
|
||||
HiLink cf3BodyChangesAttr Statement
|
||||
HiLink cf3BodyPackageMethodAttr Statement
|
||||
HiLink cf3BodyPackageModuleAttr Statement
|
||||
HiLink cf3BodyActionAttr Statement
|
||||
HiLink cf3BodyContainAttr Statement
|
||||
HiLink cf3BodyCopyFromAttr Statement
|
||||
HiLink cf3BodyVolumeAttr Statement
|
||||
HiLink cf3BodyMountAttr Statement
|
||||
HiLink cf3BodyServiceMethodAttr Statement
|
||||
HiLink cf3BodyDatabaseServerAttr Statement
|
||||
HiLink cf3BodyEnvResourcesAttr Statement
|
||||
HiLink cf3BodyMatchValueAttr Statement
|
||||
HiLink cf3BodyServiceMethodAttr Statement
|
||||
HiLink cf3BodyEnvInterfaceAttr Statement
|
||||
HiLink cf3BodyServerControlAttr Statement
|
||||
HiLink cf3BodyAgentControlAttr Statement
|
||||
HiLink cf3BodyExecutorControlAttr Statement
|
||||
HiLink cf3BodyEditDefsAttr Statement
|
||||
HiLink cf3BodyInsertSelectAttr Statement
|
||||
HiLink cf3BodyDeleteSelectAttr Statement
|
||||
HiLink cf3BodyMonitorControlAttr Statement
|
||||
HiLink cf3BodyPrintfileAttr Statement
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
let b:current_syntax = "cf3"
|
||||
|
||||
" }}}
|
||||
|
||||
" Folding {{{
|
||||
|
||||
function! CF3Folds()
|
||||
let line = getline(v:lnum)
|
||||
|
||||
" Don't include blank lines in previous fold {{{
|
||||
if line =~? '\v^\s*$'
|
||||
return '-1'
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Don't include comments in the previous fold {{{
|
||||
if line =~? '\v^\s*#.*$'
|
||||
return '-1'
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Fold bodies/bundles {{{
|
||||
let body_types = [
|
||||
\"^bundle",
|
||||
\"^body"
|
||||
\ ]
|
||||
for type in body_types
|
||||
if line =~ type
|
||||
return ">1"
|
||||
endif
|
||||
endfor
|
||||
" }}}
|
||||
|
||||
" Fold promises {{{
|
||||
let promise_types = [
|
||||
\"meta:",
|
||||
\"vars:",
|
||||
\"defaults:",
|
||||
\"classes:",
|
||||
\"users:",
|
||||
\"files:",
|
||||
\"packages:",
|
||||
\"guest_environments:",
|
||||
\"methods:",
|
||||
\"processes:",
|
||||
\"services:",
|
||||
\"commands:",
|
||||
\"storage:",
|
||||
\"databases:",
|
||||
\"access:",
|
||||
\"roles:",
|
||||
\"measurements:",
|
||||
\"reports:",
|
||||
\ ]
|
||||
for promise_type in promise_types
|
||||
if line =~ promise_type
|
||||
return ">2"
|
||||
endif
|
||||
endfor
|
||||
" }}}
|
||||
|
||||
" TODO:
|
||||
" - fold lists
|
||||
" - include trailing }'s in fdl 1
|
||||
|
||||
" If nothing matches, keep the previous foldlevel
|
||||
return '='
|
||||
|
||||
endfunction
|
||||
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=CF3Folds()
|
||||
|
||||
" }}}
|
||||
|
||||
" CREDITS
|
||||
" Neil Watson <neil@watson-wilson.ca>
|
||||
" Aleksey Tsalolikhin
|
||||
" John Coleman of Yale U
|
||||
" Matt Lesko
|
||||
" Ivan Pesin
|
||||
" Zach Himsel
|
||||
"
|
||||
" vim_cf3 files (https://github.com/neilhwatson/vim_cf3)
|
||||
" Copyright (C) 2011 Neil H. Watson <neil@watson-wilson.ca>
|
||||
"
|
||||
" This program is free software: you can redistribute it and/or modify it under
|
||||
" the terms of the GNU General Public License as published by the Free Software
|
||||
" Foundation, either version 3 of the License, or (at your option) any later
|
||||
" version.
|
||||
"
|
||||
" This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
" WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
" PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
"
|
||||
" You should have received a copy of the GNU General Public License along with
|
||||
" this program. If not, see <http://www.gnu.org/licenses/>.
|
Loading…
x
Reference in New Issue
Block a user