From bd3af29f38740d6b809f7f1902efc798508bb0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Wed, 29 Jun 2022 22:13:40 +0200 Subject: [PATCH] Nvim: add all after/ files --- .config/nvim/after/plugin/comment.rc.lua | 1 + .config/nvim/after/plugin/crates.rc.lua | 1 + .config/nvim/after/plugin/digraphs.rc.vim | 1 + .config/nvim/after/plugin/dressing.rc.lua | 116 ++++++++++++++++++++ .config/nvim/after/plugin/fterm.rc.lua | 45 ++++++++ .config/nvim/after/plugin/icons.rc.lua | 5 + .config/nvim/after/plugin/indent.rc.lua | 22 ++++ .config/nvim/after/plugin/knap.rc.lua | 29 +++++ .config/nvim/after/plugin/leap.rc.lua | 20 ++++ .config/nvim/after/plugin/md-preview.rc.vim | 1 + .config/nvim/after/plugin/neogen.rc.lua | 22 ++++ .config/nvim/after/plugin/nvim-dap.rc.lua | 0 .config/nvim/after/plugin/signature.rc.vim | 9 ++ .config/nvim/after/plugin/themer.rc.lua | 11 ++ .config/nvim/after/plugin/ufo.rc.lua | 12 ++ 15 files changed, 295 insertions(+) create mode 100644 .config/nvim/after/plugin/comment.rc.lua create mode 100644 .config/nvim/after/plugin/crates.rc.lua create mode 100644 .config/nvim/after/plugin/digraphs.rc.vim create mode 100644 .config/nvim/after/plugin/dressing.rc.lua create mode 100644 .config/nvim/after/plugin/fterm.rc.lua create mode 100644 .config/nvim/after/plugin/icons.rc.lua create mode 100644 .config/nvim/after/plugin/indent.rc.lua create mode 100644 .config/nvim/after/plugin/knap.rc.lua create mode 100644 .config/nvim/after/plugin/leap.rc.lua create mode 100644 .config/nvim/after/plugin/md-preview.rc.vim create mode 100644 .config/nvim/after/plugin/neogen.rc.lua create mode 100644 .config/nvim/after/plugin/nvim-dap.rc.lua create mode 100644 .config/nvim/after/plugin/signature.rc.vim create mode 100644 .config/nvim/after/plugin/themer.rc.lua create mode 100644 .config/nvim/after/plugin/ufo.rc.lua diff --git a/.config/nvim/after/plugin/comment.rc.lua b/.config/nvim/after/plugin/comment.rc.lua new file mode 100644 index 0000000..a844323 --- /dev/null +++ b/.config/nvim/after/plugin/comment.rc.lua @@ -0,0 +1 @@ +require('Comment').setup() diff --git a/.config/nvim/after/plugin/crates.rc.lua b/.config/nvim/after/plugin/crates.rc.lua new file mode 100644 index 0000000..1f9edce --- /dev/null +++ b/.config/nvim/after/plugin/crates.rc.lua @@ -0,0 +1 @@ +require('crates').setup() diff --git a/.config/nvim/after/plugin/digraphs.rc.vim b/.config/nvim/after/plugin/digraphs.rc.vim new file mode 100644 index 0000000..79423fa --- /dev/null +++ b/.config/nvim/after/plugin/digraphs.rc.vim @@ -0,0 +1 @@ +inoremap lua require'betterdigraphs'.digraphs("i") diff --git a/.config/nvim/after/plugin/dressing.rc.lua b/.config/nvim/after/plugin/dressing.rc.lua new file mode 100644 index 0000000..ad5c5b5 --- /dev/null +++ b/.config/nvim/after/plugin/dressing.rc.lua @@ -0,0 +1,116 @@ +require('dressing').setup({ + input = { + -- Set to false to disable the vim.ui.input implementation + enabled = true, + + -- Default prompt string + default_prompt = "➤ ", + + -- When true, will close the modal + insert_only = true, + + -- These are passed to nvim_open_win + anchor = "SW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "cursor", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + prefer_width = 40, + width = nil, + -- min_width and max_width can be a list of mixed types. + -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total" + max_width = { 140, 0.9 }, + min_width = { 20, 0.2 }, + + -- Window transparency (0-100) + winblend = 10, + -- Change default highlight groups (see :help winhl) + winhighlight = "", + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + + -- see :help dressing_get_config + get_config = nil, + }, + select = { + -- Set to false to disable the vim.ui.select implementation + enabled = true, + + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + + -- Options for telescope selector + -- These are passed into the telescope picker directly. Can be used like: + -- telescope = require('telescope.themes').get_ivy({...}) + -- telescope = require('telescope.themes').get_dropdown({}), + + -- Options for fzf selector + fzf = { + window = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for fzf_lua selector + fzf_lua = { + winopts = { + width = 0.5, + height = 0.4, + }, + }, + + -- Options for nui Menu + nui = { + position = "50%", + size = nil, + relative = "editor", + border = { + style = "rounded", + }, + max_width = 80, + max_height = 40, + }, + + -- Options for built-in selector + builtin = { + -- These are passed to nvim_open_win + anchor = "NW", + border = "rounded", + -- 'editor' and 'win' will default to being centered + relative = "editor", + + -- Window transparency (0-100) + winblend = 10, + -- Change default highlight groups (see :help winhl) + winhighlight = "", + + -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- the min_ and max_ options can be a list of mixed types. + -- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total" + width = nil, + max_width = { 140, 0.8 }, + min_width = { 40, 0.2 }, + height = nil, + max_height = 0.9, + min_height = { 10, 0.2 }, + + override = function(conf) + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + return conf + end, + }, + + -- Used to override format_item. See :help dressing-format + format_item_override = {}, + + -- see :help dressing_get_config + get_config = nil, + }, +}) diff --git a/.config/nvim/after/plugin/fterm.rc.lua b/.config/nvim/after/plugin/fterm.rc.lua new file mode 100644 index 0000000..3407245 --- /dev/null +++ b/.config/nvim/after/plugin/fterm.rc.lua @@ -0,0 +1,45 @@ +require'FTerm'.setup({ + -- Filetype of the terminal buffer + ft = 'FTerm', + + -- Command to run inside the terminal. It could be a `string` or `table` + cmd = os.getenv('SHELL'), + + -- Neovim's native window border. See `:h nvim_open_win` for more configuration options. + border = 'double', + + -- Close the terminal as soon as shell/command exits. + -- Disabling this will mimic the native terminal behaviour. + auto_close = true, + + -- Highlight group for the terminal. See `:h winhl` + hl = 'Normal', + + -- Transparency of the floating window. See `:h winblend` + blend = 0, + + -- Object containing the terminal window dimensions. + -- The value for each field should be between `0` and `1` + dimensions = { + height = 0.8, -- Height of the terminal window + width = 0.8, -- Width of the terminal window + x = 0.5, -- X axis of the terminal window + y = 0.5, -- Y axis of the terminal window + }, + + -- Callback invoked when the terminal exits. + -- See `:h jobstart-options` + on_exit = nil, + + -- Callback invoked when the terminal emits stdout data. + -- See `:h jobstart-options` + on_stdout = nil, + + -- Callback invoked when the terminal emits stderr data. + -- See `:h jobstart-options` + on_stderr = nil, +}) + +-- Example keybindings +vim.keymap.set('n', 'i', 'lua require("FTerm").toggle()') +vim.keymap.set('t', 'i', 'lua require("FTerm").toggle()') diff --git a/.config/nvim/after/plugin/icons.rc.lua b/.config/nvim/after/plugin/icons.rc.lua new file mode 100644 index 0000000..002e144 --- /dev/null +++ b/.config/nvim/after/plugin/icons.rc.lua @@ -0,0 +1,5 @@ +require("icon-picker") + +local opts = { noremap = true, silent = true } + +vim.keymap.set("n", "o", "PickIcons", opts) diff --git a/.config/nvim/after/plugin/indent.rc.lua b/.config/nvim/after/plugin/indent.rc.lua new file mode 100644 index 0000000..a45c3ff --- /dev/null +++ b/.config/nvim/after/plugin/indent.rc.lua @@ -0,0 +1,22 @@ +require("indent_blankline").setup { + char = "", + show_current_context = true, + --show_current_context_start = true, + space_char_blankline = " ", + char_highlight_list = { + "IndentBlanklineIndent1", + "IndentBlanklineIndent2", + "IndentBlanklineIndent3", + "IndentBlanklineIndent4", + "IndentBlanklineIndent5", + "IndentBlanklineIndent6", + }, + space_char_highlight_list = { + "IndentBlanklineIndent1", + "IndentBlanklineIndent2", + "IndentBlanklineIndent3", + "IndentBlanklineIndent4", + "IndentBlanklineIndent5", + "IndentBlanklineIndent6", + }, +} diff --git a/.config/nvim/after/plugin/knap.rc.lua b/.config/nvim/after/plugin/knap.rc.lua new file mode 100644 index 0000000..befd71c --- /dev/null +++ b/.config/nvim/after/plugin/knap.rc.lua @@ -0,0 +1,29 @@ +local gknapsettings = { + htmloutputext = "html", + htmltohtml = "touch %outputfile%", + htmltohtmlviewerlaunch = "google-chrome-beta %outputfile%", + htmltohtmlviewerrefresh = "none", + mdoutputext = "html", + mdtohtml = "pandoc --standalone %docroot% -o %outputfile%", + mdtohtmlviewerlaunch = "google-chrome-beta %outputfile%", + mdtohtmlviewerrefresh = "none", + mdtopdf = "pandoc %docroot% -o %outputfile%", + mdtopdfviewerlaunch = "sioyek %outputfile%", + mdtopdfviewerrefresh = "none", + markdownoutputext = "html", + markdowntohtml = "pandoc --standalone %docroot% -o %outputfile%", + markdowntohtmlviewerlaunch = "google-chrome-beta %outputfile%", + markdowntohtmlviewerrefresh = "none", + markdowntopdf = "pandoc %docroot% -o %outputfile%", + markdowntopdfviewerlaunch = "sioyek %outputfile%", + markdowntopdfviewerrefresh = "none", + texoutputext = "pdf", + textopdf = "pdflatex -interaction=batchmode -halt-on-error -synctex=1 %docroot%", + textopdfviewerlaunch = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance %outputfile%", + textopdfviewerrefresh = "none", + textopdfforwardjump = "sioyek --inverse-search 'nvim --headless -es --cmd \"lua require('\"'\"'knaphelper'\"'\"').relayjump('\"'\"'%servername%'\"'\"','\"'\"'%1'\"'\"',%2,%3)\"' --reuse-instance --forward-search-file %srcfile% --forward-search-line %line% %outputfile%", + textopdfshorterror = "A=%outputfile% ; LOGFILE=\"${A%.pdf}.log\" ; rubber-info \"$LOGFILE\" 2>&1 | head -n 1", + delay = 250 +} + +vim.g.knap_settings = gknapsettings diff --git a/.config/nvim/after/plugin/leap.rc.lua b/.config/nvim/after/plugin/leap.rc.lua new file mode 100644 index 0000000..971dcd4 --- /dev/null +++ b/.config/nvim/after/plugin/leap.rc.lua @@ -0,0 +1,20 @@ +local leap = require('leap') + +leap.setup { + case_insensitive = true, + -- Leaving the appropriate list empty effectively disables "smart" mode, + -- and forces auto-jump to be on or off. + --safe_labels = { . . . }, + --labels = { . . . }, + -- These keys are captured directly by the plugin at runtime. + special_keys = { + repeat_search = '', + next_match = '', + prev_match = '', + next_group = '', + prev_group = '', + eol = '', + }, +} + +leap.set_default_keymaps() diff --git a/.config/nvim/after/plugin/md-preview.rc.vim b/.config/nvim/after/plugin/md-preview.rc.vim new file mode 100644 index 0000000..3e866c8 --- /dev/null +++ b/.config/nvim/after/plugin/md-preview.rc.vim @@ -0,0 +1 @@ +let g:mkdp_filetypes = ['markdown', 'plantuml'] diff --git a/.config/nvim/after/plugin/neogen.rc.lua b/.config/nvim/after/plugin/neogen.rc.lua new file mode 100644 index 0000000..1bed6e1 --- /dev/null +++ b/.config/nvim/after/plugin/neogen.rc.lua @@ -0,0 +1,22 @@ +require("neogen").setup({ + --snippet_engine = 'ultisnips', + input_after_comment = true, +}) + +-- { +-- { nil, "///!", { no_results = true, type = { "func", "file", "class" } } }, +-- { nil, "///! @file", { no_results = true, type = { "file" } } }, +-- { nil, "///! * @brief $1", { no_results = true, type = { "func", "file", "class" } } }, +-- { nil, "", { no_results = true, type = { "func", "file", "class" } } }, +-- { nil, "", { no_results = true, type = { "file" } } }, +-- +-- { nil, "/**", { type = { "func", "class", "type" } } }, +-- { i.ClassName, " * @class %s", { type = { "class" } } }, +-- { i.Type, " * @typedef %s", { type = { "type" } } }, +-- { nil, " * @brief $1", { type = { "func", "class", "type" } } }, +-- { nil, " *", { type = { "func", "class", "type" } } }, +-- { i.Tparam, " * @tparam %s $1" }, +-- { i.Parameter, " * @param %s $1" }, +-- { i.Return, " * @return $1" }, +-- { nil, " */", { type = { "func", "class", "type" } } }, +-- } diff --git a/.config/nvim/after/plugin/nvim-dap.rc.lua b/.config/nvim/after/plugin/nvim-dap.rc.lua new file mode 100644 index 0000000..e69de29 diff --git a/.config/nvim/after/plugin/signature.rc.vim b/.config/nvim/after/plugin/signature.rc.vim new file mode 100644 index 0000000..868ce1a --- /dev/null +++ b/.config/nvim/after/plugin/signature.rc.vim @@ -0,0 +1,9 @@ +"let g:signature_help_config = { +" \ 'border': v:true, +" \ 'maxWidth': 80, +" \ 'maxHeight': 30, +" \ 'style': "virtual", +" \ 'onTriggerChar': v:false, +" \ 'multiLabel': v:false, +" \ } +"call signature_help#enable() diff --git a/.config/nvim/after/plugin/themer.rc.lua b/.config/nvim/after/plugin/themer.rc.lua new file mode 100644 index 0000000..302fe03 --- /dev/null +++ b/.config/nvim/after/plugin/themer.rc.lua @@ -0,0 +1,11 @@ +require("themer").setup({ + colorscheme = "scery", + enable_installer = true, + styles = { + ["function"] = { style = 'italic' }, + functionbuiltin = { style = 'italic' }, + variable = { style = 'italic' }, + variableBuiltIn = { style = 'italic' }, + parameter = { style = 'italic' }, + }, +}) diff --git a/.config/nvim/after/plugin/ufo.rc.lua b/.config/nvim/after/plugin/ufo.rc.lua new file mode 100644 index 0000000..058f962 --- /dev/null +++ b/.config/nvim/after/plugin/ufo.rc.lua @@ -0,0 +1,12 @@ +vim.wo.foldcolumn = '1' +vim.wo.foldlevel = 99 -- feel free to decrease the value +vim.wo.foldenable = true + +-- tell the sever the capability of foldingRange +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true +} + +--require('ufo').setup()