neovim

Personal neovim configuration files
git clone git://gtms.dev/neovim
Log | Files | Refs

commit 07bc6a1c9c4bbed5fa01f64fd77036e5c6a20e80
parent 4076e9eb4d5d8664670e4d1b469c75268d5bbd82
Author: Tomas Nemec <owl@gtms.dev>
Date:   Sun,  6 Apr 2025 08:47:00 +0200

update

Diffstat:
Aafter/ftplugin/bash.lua | 3+++
Aafter/ftplugin/dap-repl.lua | 12++++++++++++
Aafter/ftplugin/dart.lua | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rftplugin/gdscript.lua -> after/ftplugin/gdscript.lua | 0
Rftplugin/gitcommit.lua -> after/ftplugin/gitcommit.lua | 0
Aafter/ftplugin/go.lua | 24++++++++++++++++++++++++
Aafter/ftplugin/html.lua | 4++++
Aafter/ftplugin/htmlangular.lua | 6++++++
Aafter/ftplugin/java.lua | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rftplugin/javascript.lua -> after/ftplugin/javascript.lua | 0
Rftplugin/json.lua -> after/ftplugin/json.lua | 0
Aafter/ftplugin/lua.lua | 44++++++++++++++++++++++++++++++++++++++++++++
Aafter/ftplugin/mail.lua | 4++++
Rftplugin/neorg.lua -> after/ftplugin/neorg.lua | 0
Rftplugin/qf.lua -> after/ftplugin/qf.lua | 0
Aafter/ftplugin/scheme.lua | 2++
Aafter/ftplugin/sh.lua | 9+++++++++
Aafter/ftplugin/zig.lua | 3+++
Aafter/ftplugin/zsh.lua | 27+++++++++++++++++++++++++++
Mafter/plugin/lsp.lua | 31++++++++++++++++---------------
Mafter/plugin/telescope.lua | 18++++++++++++------
Mafter/plugin/treesitter.lua | 38+++++++++++---------------------------
Dftplugin/bash.lua | 1-
Dftplugin/dap-repl.lua | 10----------
Dftplugin/dart.lua | 92-------------------------------------------------------------------------------
Dftplugin/go.lua | 23-----------------------
Dftplugin/html.lua | 2--
Dftplugin/htmlangular.lua | 3---
Dftplugin/java.lua | 102-------------------------------------------------------------------------------
Dftplugin/lua.lua | 36------------------------------------
Dftplugin/mail.lua | 3---
Dftplugin/scheme.lua | 1-
Dftplugin/sh.lua | 8--------
Dftplugin/zig.lua | 2--
Dftplugin/zsh.lua | 26--------------------------
Mlua/plugins.lua | 6+++---
Dlua/tms/p/telescope.lua | 28----------------------------
Alua/tms/p/telescope/init.lua | 4++++
Alua/tms/p/telescope/mail_address.lua | 30++++++++++++++++++++++++++++++
Alua/tms/p/telescope/multigrep.lua | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
Mplugin/options.lua | 72+++++++++++++++++++++++++++++++++++++-----------------------------------
41 files changed, 501 insertions(+), 423 deletions(-)

diff --git a/after/ftplugin/bash.lua b/after/ftplugin/bash.lua @@ -0,0 +1,3 @@ +local set = vim.opt_local + +set.expandtab = false diff --git a/after/ftplugin/dap-repl.lua b/after/ftplugin/dap-repl.lua @@ -0,0 +1,12 @@ +if not pcall(require, 'terminal') then + return +end + +local set = vim.opt_local +set.conceallevel = 2 +set.concealcursor = 'nc' +set.wrap = false + +local terminal = require('terminal') +local rgb_color_table = terminal.initialize_terminal_colors() +terminal.attach_to_buffer(vim.api.nvim_get_current_buf(), rgb_color_table) diff --git a/after/ftplugin/dart.lua b/after/ftplugin/dart.lua @@ -0,0 +1,94 @@ +local set = vim.opt_local +set.comments = [[sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://]] +set.commentstring = '//%s' +set.includeexpr = [[v:lua.require('tms.ft.dart.package').package_path(v:fname)]] +set.isfname:append { ':' } +set.iskeyword:append { '$' } +set.include = [[^import\s*]] +set.textwidth = 80 +set.shiftwidth = 2 +set.formatoptions:remove('t') +set.makeprg = [[dart %]] +set.efm = [[%f:%l:%c: %m]] +set.foldmethod = 'expr' +set.foldlevel = 99 + +vim.b.undo_ftplugin = 'setl com< cms< inex< isf<' +vim.cmd.iabbrev('STring', 'String') + +if pcall(require, 'no-neck-pain') and not require 'no-neck-pain.state'.enabled and not vim.g.no_neck_init then + require 'no-neck-pain'.enable() + -- at start cursor is in left most window + vim.schedule(function() + vim.cmd [[exe "normal \<c-w>l"]] + end) + vim.g.no_neck_init = true +end + +local full_path = vim.fn.expand('%:p') +if string.find(full_path, '%.pub%-cache') then + vim.bo.modifiable = false +end + +require 'tms.lsp.dart'.start() + +vim.keymap.set('n', '<leader>ar', ':make<cr>', { desc = 'Dart Run' }) +vim.keymap.set('n', '<leader>at', ':DartTest<cr>', { desc = 'Dart Test' }) +vim.keymap.set('n', '<leader>an', vim.cmd.Trun, { desc = 'Trun' }) + +vim.api.nvim_buf_create_user_command(0, 'NgProvided', function() + vim.lsp.buf.references(nil, { on_list = require 'tms.lsp.dart'.provided_references }) +end, {}) + +vim.api.nvim_buf_create_user_command(0, 'DartTest', function() + local temp_makeprg = vim.bo.makeprg + vim.bo.makeprg = [[dart test --no-color -r expanded %]] + vim.cmd.make() + vim.bo.makeprg = temp_makeprg +end, {}) + +if pcall(require, 'dart-tools') then + local dt_lsp = require 'dart-tools.lsp' + local dt_req = require 'dart-tools.lsp.request' + local ddebug = require 'tms.ft.dart.debug' + local analyze = require 'tms.ft.dart.analyze' + + local cmd_opts = {} + vim.api.nvim_buf_create_user_command(0, 'DartDebug', ddebug.func, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartPrint', ddebug.print, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartOrganizeImports', dt_lsp.organize_imports, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartFixAll', dt_lsp.fix_all, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartExtract', dt_lsp.extract_method, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartVariable', dt_lsp.extract_local_variable, cmd_opts) + vim.api.nvim_buf_create_user_command(0, 'DartAnalyze', analyze.qf2131, cmd_opts) + + local opts = function(desc) + return { buffer = true, desc = desc } + end + -- vim.keymap.set('n', '<leader>ap', function() + -- ddebug.print() + -- end, opts('Dart Debug Print')) + vim.keymap.set('n', '<leader>ao', dt_lsp.organize_imports, opts('Dart Organize Imports')) + vim.keymap.set('n', '<leader>af', dt_lsp.fix_all, opts('Dart Fix All')) + vim.keymap.set({ 'v', 'n' }, '<leader>ai', dt_lsp.inline_local_variable, opts('Dart Inline Local Varibale')) + vim.keymap.set({ 'v', 'n' }, '<leader>ae', dt_lsp.extract_local_variable, opts('Dart Extract Local Varibale')) + vim.keymap.set({ 'v', 'n' }, '<leader>am', dt_lsp.extract_method, opts('Dart Extract Method')) + vim.keymap.set('n', '<leader>al', dt_lsp.list_code_action_kinds, opts('Dart List Code Actions')) + vim.keymap.set('n', '<leader>as', function() + dt_req.execute_command('refactor.splitVariableDeclaration') + end, opts('Dart Split Variable Declaration')) + vim.keymap.set('n', '<leader>aj', function() + dt_req.execute_command('refactor.joinVariableDeclaration') + end, opts('Dart Join Variable Declaration')) + vim.keymap.set('n', '<leader>ax', function() + dt_req.execute_command('refactor.convert.bodyToExpression') + end, opts('Dart Convert To Expression')) + vim.keymap.set('n', '<leader>aa', function() + dt_req.execute_command('refactor.convert.bodyToAsync') + end, opts('Dart Convert To Async')) + vim.keymap.set('n', '<leader>ab', function() + dt_req.execute_command('refactor.convert.bodyToBlock') + end, opts('Dart Convert To Block')) + vim.keymap.set('n', '<leader>ad', dt_lsp.super, opts('Dart Go to Super Definition')) + -- vim.keymap.set('n', '<leader>ap', dt_lsp.import, opts('Dart Go to Import')) +end diff --git a/ftplugin/gdscript.lua b/after/ftplugin/gdscript.lua diff --git a/ftplugin/gitcommit.lua b/after/ftplugin/gitcommit.lua diff --git a/after/ftplugin/go.lua b/after/ftplugin/go.lua @@ -0,0 +1,24 @@ +local set = vim.opt_local +set.makeprg = [[go run %]] + +vim.lsp.start(require 'tms.lsp'.make_opts('gopls')) + +-- vim.cmd [[command! -buffer -nargs=? Godoc lua require('tms.ft.go.doc').godoc(vim.fn.expand('<args>'), vim.fn.expand('<cword>'))]] +vim.api.nvim_create_autocmd('BufWritePre', + { + callback = require 'tms.ft.go'.org_imports, + buffer = 0, + desc = 'Go Organize Imports', + } +) + +vim.keymap.set('n', '<leader>ao', require 'tms.ft.go'.org_imports, { buffer = true, desc = 'Go Organize Imports' }) +vim.keymap.set('n', '<leader>ar', ':make<cr>', { buffer = true }) +vim.keymap.set('n', '<leader>at', ':GoTest<cr>', { buffer = true }) + +vim.api.nvim_buf_create_user_command(0, 'GoTest', function() + local tmp = vim.bo.makeprg + vim.bo.makeprg = 'go test ./...' + vim.cmd.make() + vim.bo.makeprg = tmp +end, {}) diff --git a/after/ftplugin/html.lua b/after/ftplugin/html.lua @@ -0,0 +1,4 @@ +-- require 'tms.lsp.dart'.start() + +local set = vim.opt_local +set.shiftwidth = 4 diff --git a/after/ftplugin/htmlangular.lua b/after/ftplugin/htmlangular.lua @@ -0,0 +1,6 @@ +-- require 'tms.lsp.dart'.start() + +local set = vim.opt_local +set.shiftwidth = 4 + +vim.treesitter.start(nil, 'html') diff --git a/after/ftplugin/java.lua b/after/ftplugin/java.lua @@ -0,0 +1,103 @@ +local set = vim.opt_local +set.shiftwidth = 4 + +-- If you started neovim within `~/dev/xy/project-1` this would resolve to `project-1` +local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t') +local root_dir = vim.fs.root(0, { ".git", "pom.xml", "mvnw", "gradlew" }) + +local bundles = { + vim.fn.glob(vim.env.MASON .. "/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar", + true) +} +vim.list_extend(bundles, + vim.split(vim.fn.glob(vim.env.MASON .. "/packages/java-test/extension/server/*.jar", true), "\n")) + +-- See `:help vim.lsp.start_client` for an overview of the supported `config` options. +local config = { + -- The command that starts the language server + -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line + cmd = { + + -- ๐Ÿ’€ + 'java', -- or '/path/to/java17_or_newer/bin/java' + -- depends on if `java` is in your $PATH env variable and if it points to the right version. + + '-Declipse.application=org.eclipse.jdt.ls.core.id1', + '-Dosgi.bundles.defaultStartLevel=4', + '-Declipse.product=org.eclipse.jdt.ls.core.product', + '-Dlog.protocol=true', + '-Dlog.level=ALL', + '-Xmx1g', + '--add-modules=ALL-SYSTEM', + '--add-opens', 'java.base/java.util=ALL-UNNAMED', + '--add-opens', 'java.base/java.lang=ALL-UNNAMED', + + -- repository/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar + "-javaagent:" .. + vim.env.XDG_DATA_HOME .. + "/containers/storage/volumes/maven/_data/repository/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar", + + -- ๐Ÿ’€ + '-jar', vim.env.MASON .. '/packages/jdtls/plugins/org.eclipse.equinox.launcher_1.6.900.v20240613-2009.jar', + -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ + -- Must point to the Change this to + -- eclipse.jdt.ls installation the actual version + + + -- ๐Ÿ’€ + '-configuration', vim.env.MASON .. '/packages/jdtls/config_linux', + -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^ + -- Must point to the Change to one of `linux`, `win` or `mac` + -- eclipse.jdt.ls installation Depending on your system. + + + -- ๐Ÿ’€ + -- See `data directory configuration` section in the README + '-data', vim.env.XDG_CACHE_HOME .. '/jdtls/' .. project_name + }, + + -- ๐Ÿ’€ + -- This is the default if not provided, you can remove it. Or adjust as needed. + -- One dedicated LSP server & client will be started per unique root_dir + -- + -- vim.fs.root requires Neovim 0.10. + -- If you're using an earlier version, use: require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}), + root_dir = root_dir, + + -- Here you can configure eclipse.jdt.ls specific settings + -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request + -- for a list of options + settings = { + -- java.configuration.maven.userSettings + java = { + configuration = { + jdt = { + ls = { + lombokSupport = { enabled = false } + } + }, + maven = { + userSettings = root_dir .. '/maven-settings-local.xml' + } + } + } + }, + + -- Language server `initializationOptions` + -- You need to extend the `bundles` with paths to jar files + -- if you want to use additional eclipse.jdt.ls plugins. + -- + -- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation + -- + -- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this + init_options = { + bundles = bundles, + }, +} +-- This starts a new client & server, +-- or attaches to an existing client & server depending on the `root_dir`. +require('jdtls').start_or_attach(config) + +vim.api.nvim_create_user_command('JdtTestClass', require 'jdtls'.test_class, { desc = 'Test Class' }) +vim.api.nvim_create_user_command('JdtTestMethod', require 'jdtls'.test_nearest_method, { desc = 'Test Nearest Method' }) +vim.api.nvim_create_user_command('JdtTestPick', require 'jdtls'.pick_test, { desc = 'Pick Test' }) diff --git a/ftplugin/javascript.lua b/after/ftplugin/javascript.lua diff --git a/ftplugin/json.lua b/after/ftplugin/json.lua diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua @@ -0,0 +1,44 @@ +local set = vim.opt_local + +set.efm = [[lua: %f:%l: %m]] +set.makeprg = [[lua %:S]] +set.shiftwidth = 2 + +vim.keymap.set('n', '<leader>ar', vim.cmd.make) + +if pcall(require, 'lazydev') then + require 'lazydev'.setup { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + } + } +end + +-- vim.lsp.start { +-- name = 'lua-language-server', +-- cmd = { 'lua-language-server' }, +-- capabilities = require 'tms.lsp'.capabilities(), +-- root_dir = vim.fn.getcwd(), +-- settings = { +-- Lua = { +-- runtime = { version = 'LuaJIT' }, +-- diagnostics = { +-- -- +-- globals = { 'vim' }, +-- disable = { 'missing-parameter' }, +-- }, +-- telemetry = { enable = false }, +-- workspace = { +-- checkThirdParty = false, +-- -- slow compared to neodev +-- -- library = vim.api.nvim_get_runtime_file('', true), +-- -- library = { vim.env.VIMRUNTIME }, +-- }, +-- completion = { callSnippet = 'Replace' }, +-- }, +-- }, +-- } + +vim.api.nvim_set_hl(0, '@lsp.mod.defaultLibrary.lua', { link = 'Special' }) diff --git a/after/ftplugin/mail.lua b/after/ftplugin/mail.lua @@ -0,0 +1,4 @@ +local set = vim.opt_local +set.spell = true +set.spelllang = { 'cs', 'csa', 'en' } +vim.keymap.set('n', '<leader>aa', require 'tms.p.telescope'.mail_address, { buffer = true }) diff --git a/ftplugin/neorg.lua b/after/ftplugin/neorg.lua diff --git a/ftplugin/qf.lua b/after/ftplugin/qf.lua diff --git a/after/ftplugin/scheme.lua b/after/ftplugin/scheme.lua @@ -0,0 +1,2 @@ +local set = vim.opt_local +set.filetype = 'query' diff --git a/after/ftplugin/sh.lua b/after/ftplugin/sh.lua @@ -0,0 +1,9 @@ +local set = vim.opt_local +set.makeprg = [[sh %:S]] +set.efm = [[%f: line %l: %m]] +set.expandtab = false + +local cmp = require('cmp') +cmp.setup.buffer { sources = { { name = 'nvim_lsp' }, { name = 'exe' }, { name = 'path' } } } + +vim.keymap.set('n', '<leader>ar', vim.cmd.make, { buffer = true }) diff --git a/after/ftplugin/zig.lua b/after/ftplugin/zig.lua @@ -0,0 +1,3 @@ +-- vim.cmd.compiler "zig" + +vim.treesitter.start(0, "zig") diff --git a/after/ftplugin/zsh.lua b/after/ftplugin/zsh.lua @@ -0,0 +1,27 @@ +local set = vim.opt_local +set.makeprg = [[zsh -n -- %:S]] +set.efm = [[%f:%l: %m,%f: line %l: %m, %-G%.%#]] +set.expandtab = false + +if pcall(require, 'cmp') then + require 'cmp'.setup.buffer { + -- completion = { autocomplete = false }, + sources = { + -- + { name = 'zsh' }, + { name = 'nvim_lsp' }, + { name = 'exe' }, + { name = 'path' }, + }, + } +end + +vim.keymap.set('n', '<leader>ar', function() + local temp_prg = set.makeprg + local temp_efm = set.efm + set.makeprg = [[./%]] + set.efm = [[%f:%.%#:%l:\ %m,%f:%l:\ %m,%-G%.%#]] + vim.cmd.make() + set.makeprg = temp_prg + set.efm = temp_efm +end, { buffer = true }) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua @@ -13,11 +13,12 @@ local function keymap(client, buf) local prefix = 'gl' - if client.supports_method('textDocument/hover') then - vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = 'single' } end, opts 'LSP Hover') + if client:supports_method('textDocument/hover') then + vim.keymap.set('n', 'K', function() vim.lsp.buf.hover { border = 'single' } end, + opts 'LSP Hover') end - if client.supports_method('textDocument/definition') then + if client:supports_method('textDocument/definition') then vim.keymap.set('n', prefix .. 'd', vim.lsp.buf.definition, opts 'LSP Definition') vim.keymap.set('n', '<c-s><c-]>', function() vim.cmd.vsplit() @@ -25,19 +26,19 @@ local function keymap(client, buf) end, opts 'LSP Definition (VSplit)') end - if client.supports_method('textDocument/typeDefinition') then + if client:supports_method('textDocument/typeDefinition') then vim.keymap.set('n', prefix .. 't', vim.lsp.buf.type_definition, opts 'LSP Type Definition') end - if client.supports_method('callHierarchy/incomingCalls') then + if client:supports_method('callHierarchy/incomingCalls') then vim.keymap.set('n', ']c', vim.lsp.buf.incoming_calls, opts 'LSP Incoming calls') end - if client.supports_method('callHierarchy/outgoingCalls') then + if client:supports_method('callHierarchy/outgoingCalls') then vim.keymap.set('n', '[c', vim.lsp.buf.outgoing_calls, opts 'LSP Outgoing calls') end - if client.supports_method('textDocument/implementation') then + if client:supports_method('textDocument/implementation') then vim.keymap.set('n', prefix .. 'm', vim.lsp.buf.implementation, opts 'LSP Implementation') vim.keymap.set('n', '<c-w>' .. prefix .. 'm', function() vim.cmd.split() @@ -49,13 +50,13 @@ local function keymap(client, buf) end, opts 'LSP Implementation (VSplit)') end - if client.supports_method('textDocument/signatureHelp') then + if client:supports_method('textDocument/signatureHelp') then vim.keymap.set('i', '<c-s>', function() vim.lsp.buf.signature_help { border = 'single' } end, opts 'LSP Signature Help') end - if client.supports_method('textDocument/references') then + if client:supports_method('textDocument/references') then local references = { all = function() vim.lsp.buf.references { includeDeclaration = false } end, first_in_file = function() @@ -85,35 +86,35 @@ local function keymap(client, buf) vim.keymap.set('n', ']r', references.next, opts 'Next Reference') end - if client.supports_method('textDocument/codeAction') then + if client:supports_method('textDocument/codeAction') then vim.keymap.set({ 'n', 'v' }, prefix .. 'a', vim.lsp.buf.code_action, opts 'LSP Code Actions') end - if client.supports_method('textDocument/documentHighlight') then + if client:supports_method('textDocument/documentHighlight') then vim.keymap.set('n', '<leader>k', vim.lsp.buf.document_highlight, opts 'LSP Highlight') vim.api.nvim_create_autocmd('CursorMoved', { group = lsp_group, buffer = buf, callback = vim.lsp.buf.clear_references }) end - if client.supports_method('textDocument/inlayHint') then + if client:supports_method('textDocument/inlayHint') then vim.keymap.set('n', prefix .. 'h', function() ---@diagnostic disable-next-line: missing-parameter vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end, opts 'LSP Inlay hints') end - if client.supports_method('textDocument/rename') then + if client:supports_method('textDocument/rename') then vim.keymap.set('n', 'cd', vim.lsp.buf.rename, opts 'LSP Rename (Change Definition)') vim.keymap.set('n', prefix .. 'n', vim.lsp.buf.rename, opts 'LSP Rename') end - if client.supports_method('typeHierarchy/supertypes') then + if client:supports_method('typeHierarchy/supertypes') then vim.keymap.set('n', prefix .. 'p', function() vim.lsp.buf.typehierarchy('supertypes') end, opts 'LSP Supertypes (Parents)') end - if client.supports_method('typeHierarchy/subtypes') then + if client:supports_method('typeHierarchy/subtypes') then vim.keymap.set('n', prefix .. 'c', function() vim.lsp.buf.typehierarchy('subtypes') end, opts 'LSP Subtypes (Children)') diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua @@ -3,7 +3,7 @@ if not pcall(require, 'telescope') then end require 'telescope'.setup { - defaults = require 'telescope.themes'.get_dropdown({ + defaults = require 'telescope.themes'.get_ivy({ layout_config = { width = 120 }, path_display = { filename_first = { reverse_directories = true }, @@ -22,14 +22,15 @@ require 'telescope'.setup { git_status = { previewer = false, } - } + }, - -- defaults = { mappings = { i = { ['<esc>'] = actions.close, ['<c-y>'] = actions.select_default } } }, - -- extensions = { fzy_native = { override_generic_sorter = false, override_file_sorter = true } }, + extensions = { + fzf = {} + }, } -- extensions --- pcall(telescope.load_extension, 'fzy_native') +require 'telescope'.load_extension('fzf') -- pcall(telescope.load_extension, 'dap') pcall(require('telescope').load_extension, 'zk') pcall(require('telescope').load_extension, 'git_worktree') @@ -55,7 +56,7 @@ vim.keymap.set('n', '<space>o', require 'telescope.builtin'.oldfiles, { desc = ' vim.keymap.set('n', '<space>s', require 'telescope.builtin'.spell_suggest, { desc = 'Telescope Spell Suggest' }) vim.keymap.set('n', '<space>t', require 'telescope.builtin'.treesitter, { desc = 'Telescope Treesitter' }) vim.keymap.set('n', '<space>c', require 'telescope.builtin'.git_status, { desc = 'Telescope Git Status' }) -vim.keymap.set('n', '<space>e', require 'telescope.builtin'.grep_string, { desc = 'Telescope Grep String' }) +vim.keymap.set('n', '<space>e', require 'tms.p.telescope'.multigrep, { desc = 'Telescope Multi Grep' }) vim.keymap.set('n', '<space>l', require 'telescope.builtin'.current_buffer_fuzzy_find, { desc = 'Telescope Buffer Lines' }) vim.keymap.set('n', '<space>b', require 'telescope.builtin'.buffers, { desc = 'Telescope Buffers' }) @@ -69,6 +70,11 @@ vim.keymap.set('n', '<space>wo', require 'telescope'.extensions.git_worktree.git vim.keymap.set('n', '<space>wi', require 'telescope'.extensions.git_worktree.create_git_worktree, { desc = 'Telescope Git Worktree Create' }) vim.keymap.set('n', '<space>n', rhs.find_dotfiles, { desc = 'Telescope Dotfiles' }) +vim.keymap.set('n', '<space>p', function() + require 'telescope.builtin'.find_files { + cwd = vim.fs.joinpath(vim.fn.stdpath 'data', 'site/pack/paqs'), + } +end, { desc = 'Telescope Dotfiles' }) local group = vim.api.nvim_create_augroup('user-telescope', {}) vim.api.nvim_create_autocmd('LspAttach', { diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua @@ -2,36 +2,20 @@ if not pcall(require, 'nvim-treesitter') then return end -local parser_configs = require 'nvim-treesitter.parsers'.get_parser_configs() - -parser_configs.norg = { - install_info = { - url = 'https://github.com/nvim-neorg/tree-sitter-norg', - files = { 'src/parser.c', 'src/scanner.cc' }, - branch = 'main', - }, -} - -parser_configs.norg_meta = { - install_info = { - url = 'https://github.com/nvim-neorg/tree-sitter-norg-meta', - files = { 'src/parser.c' }, - branch = 'main', - }, -} - -parser_configs.norg_table = { - install_info = { - url = 'https://github.com/nvim-neorg/tree-sitter-norg-table', - files = { 'src/parser.c' }, - branch = 'main', - }, -} - +---@diagnostic disable-next-line: missing-fields require 'nvim-treesitter.configs'.setup { -- ensure_intalled = 'all', -- ignore_install = { 'lua', 'vim', 'c' }, - highlight = { enable = true }, + 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, + }, indent = { enable = true }, diff --git a/ftplugin/bash.lua b/ftplugin/bash.lua @@ -1 +0,0 @@ -vim.bo.expandtab = false diff --git a/ftplugin/dap-repl.lua b/ftplugin/dap-repl.lua @@ -1,10 +0,0 @@ -if not pcall(require, 'terminal') then - return -end - -local terminal = require('terminal') -local rgb_color_table = terminal.initialize_terminal_colors() -vim.api.nvim_set_option_value('conceallevel', 2, { buf = 0 }) -vim.api.nvim_set_option_value('concealcursor', 'nc', { buf = 0 }) -vim.api.nvim_set_option_value('wrap', false, { buf = 0 }) -terminal.attach_to_buffer(vim.api.nvim_get_current_buf(), rgb_color_table) diff --git a/ftplugin/dart.lua b/ftplugin/dart.lua @@ -1,92 +0,0 @@ -vim.opt_local.comments = [[sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:///,://]] -vim.opt_local.commentstring = '//%s' -vim.opt_local.includeexpr = [[v:lua.require('tms.ft.dart.package').package_path(v:fname)]] -vim.opt_local.isfname:append { ':' } -vim.opt_local.iskeyword:append { '$' } -vim.opt_local.include = [[^import\s*]] -vim.opt_local.textwidth = 80 -vim.opt_local.shiftwidth = 2 -vim.opt_local.formatoptions:remove('t') -vim.opt_local.makeprg = [[dart %]] -vim.opt_local.efm = [[%f:%l:%c: %m]] -vim.opt_local.foldmethod = 'expr' -vim.opt_local.foldlevel = 99 -vim.b.undo_ftplugin = 'setl com< cms< inex< isf<' -vim.cmd.iabbrev('STring', 'String') - -if pcall(require, 'no-neck-pain') and not require 'no-neck-pain.state'.enabled and not vim.g.no_neck_init then - require 'no-neck-pain'.enable() - -- at start cursor is in left most window - vim.schedule(function() - vim.cmd [[exe "normal \<c-w>l"]] - end) - vim.g.no_neck_init = true -end - -local full_path = vim.fn.expand('%:p') -if string.find(full_path, '%.pub%-cache') then - vim.bo.modifiable = false -end - -require 'tms.lsp.dart'.start() - -vim.keymap.set('n', '<leader>ar', ':make<cr>', { desc = 'Dart Run' }) -vim.keymap.set('n', '<leader>at', ':DartTest<cr>', { desc = 'Dart Test' }) -vim.keymap.set('n', '<leader>an', vim.cmd.Trun, { desc = 'Trun' }) - -vim.api.nvim_buf_create_user_command(0, 'NgProvided', function() - vim.lsp.buf.references(nil, { on_list = require 'tms.lsp.dart'.provided_references }) -end, {}) - -vim.api.nvim_buf_create_user_command(0, 'DartTest', function() - local temp_makeprg = vim.bo.makeprg - vim.bo.makeprg = [[dart test --no-color -r expanded %]] - vim.cmd.make() - vim.bo.makeprg = temp_makeprg -end, {}) - -if pcall(require, 'dart-tools') then - local dt_lsp = require 'dart-tools.lsp' - local dt_req = require 'dart-tools.lsp.request' - local ddebug = require 'tms.ft.dart.debug' - local analyze = require 'tms.ft.dart.analyze' - - local cmd_opts = {} - vim.api.nvim_buf_create_user_command(0, 'DartDebug', ddebug.func, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartPrint', ddebug.print, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartOrganizeImports', dt_lsp.organize_imports, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartFixAll', dt_lsp.fix_all, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartExtract', dt_lsp.extract_method, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartVariable', dt_lsp.extract_local_variable, cmd_opts) - vim.api.nvim_buf_create_user_command(0, 'DartAnalyze', analyze.qf2131, cmd_opts) - - local opts = function(desc) - return { buffer = true, desc = desc } - end - -- vim.keymap.set('n', '<leader>ap', function() - -- ddebug.print() - -- end, opts('Dart Debug Print')) - vim.keymap.set('n', '<leader>ao', dt_lsp.organize_imports, opts('Dart Organize Imports')) - vim.keymap.set('n', '<leader>af', dt_lsp.fix_all, opts('Dart Fix All')) - vim.keymap.set({ 'v', 'n' }, '<leader>ai', dt_lsp.inline_local_variable, opts('Dart Inline Local Varibale')) - vim.keymap.set({ 'v', 'n' }, '<leader>ae', dt_lsp.extract_local_variable, opts('Dart Extract Local Varibale')) - vim.keymap.set({ 'v', 'n' }, '<leader>am', dt_lsp.extract_method, opts('Dart Extract Method')) - vim.keymap.set('n', '<leader>al', dt_lsp.list_code_action_kinds, opts('Dart List Code Actions')) - vim.keymap.set('n', '<leader>as', function() - dt_req.execute_command('refactor.splitVariableDeclaration') - end, opts('Dart Split Variable Declaration')) - vim.keymap.set('n', '<leader>aj', function() - dt_req.execute_command('refactor.joinVariableDeclaration') - end, opts('Dart Join Variable Declaration')) - vim.keymap.set('n', '<leader>ax', function() - dt_req.execute_command('refactor.convert.bodyToExpression') - end, opts('Dart Convert To Expression')) - vim.keymap.set('n', '<leader>aa', function() - dt_req.execute_command('refactor.convert.bodyToAsync') - end, opts('Dart Convert To Async')) - vim.keymap.set('n', '<leader>ab', function() - dt_req.execute_command('refactor.convert.bodyToBlock') - end, opts('Dart Convert To Block')) - vim.keymap.set('n', '<leader>ad', dt_lsp.super, opts('Dart Go to Super Definition')) - -- vim.keymap.set('n', '<leader>ap', dt_lsp.import, opts('Dart Go to Import')) -end diff --git a/ftplugin/go.lua b/ftplugin/go.lua @@ -1,23 +0,0 @@ -vim.bo.makeprg = [[go run %]] - -vim.lsp.start(require 'tms.lsp'.make_opts('gopls')) - --- vim.cmd [[command! -buffer -nargs=? Godoc lua require('tms.ft.go.doc').godoc(vim.fn.expand('<args>'), vim.fn.expand('<cword>'))]] -vim.api.nvim_create_autocmd('BufWritePre', - { - callback = require 'tms.ft.go'.org_imports, - buffer = 0, - desc = 'Go Organize Imports', - } -) - -vim.keymap.set('n', '<leader>ao', require 'tms.ft.go'.org_imports, { buffer = true, desc = 'Go Organize Imports' }) -vim.keymap.set('n', '<leader>ar', ':make<cr>', { buffer = true }) -vim.keymap.set('n', '<leader>at', ':GoTest<cr>', { buffer = true }) - -vim.api.nvim_buf_create_user_command(0, 'GoTest', function() - local tmp = vim.bo.makeprg - vim.bo.makeprg = 'go test ./...' - vim.cmd.make() - vim.bo.makeprg = tmp -end, {}) diff --git a/ftplugin/html.lua b/ftplugin/html.lua @@ -1,2 +0,0 @@ --- require 'tms.lsp.dart'.start() -vim.o.shiftwidth = 4 diff --git a/ftplugin/htmlangular.lua b/ftplugin/htmlangular.lua @@ -1,3 +0,0 @@ --- require 'tms.lsp.dart'.start() -vim.o.shiftwidth = 4 -vim.treesitter.start(nil, 'html') diff --git a/ftplugin/java.lua b/ftplugin/java.lua @@ -1,102 +0,0 @@ -vim.o.shiftwidth = 4 - --- If you started neovim within `~/dev/xy/project-1` this would resolve to `project-1` -local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':p:h:t') -local root_dir = vim.fs.root(0, { ".git", "pom.xml", "mvnw", "gradlew" }) - -local bundles = { - vim.fn.glob(vim.env.MASON .. "/packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar", - true) -} -vim.list_extend(bundles, - vim.split(vim.fn.glob(vim.env.MASON .. "/packages/java-test/extension/server/*.jar", true), "\n")) - --- See `:help vim.lsp.start_client` for an overview of the supported `config` options. -local config = { - -- The command that starts the language server - -- See: https://github.com/eclipse/eclipse.jdt.ls#running-from-the-command-line - cmd = { - - -- ๐Ÿ’€ - 'java', -- or '/path/to/java17_or_newer/bin/java' - -- depends on if `java` is in your $PATH env variable and if it points to the right version. - - '-Declipse.application=org.eclipse.jdt.ls.core.id1', - '-Dosgi.bundles.defaultStartLevel=4', - '-Declipse.product=org.eclipse.jdt.ls.core.product', - '-Dlog.protocol=true', - '-Dlog.level=ALL', - '-Xmx1g', - '--add-modules=ALL-SYSTEM', - '--add-opens', 'java.base/java.util=ALL-UNNAMED', - '--add-opens', 'java.base/java.lang=ALL-UNNAMED', - - -- repository/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar - "-javaagent:" .. - vim.env.XDG_DATA_HOME .. - "/containers/storage/volumes/maven/_data/repository/org/projectlombok/lombok/1.18.34/lombok-1.18.34.jar", - - -- ๐Ÿ’€ - '-jar', vim.env.MASON .. '/packages/jdtls/plugins/org.eclipse.equinox.launcher_1.6.900.v20240613-2009.jar', - -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ - -- Must point to the Change this to - -- eclipse.jdt.ls installation the actual version - - - -- ๐Ÿ’€ - '-configuration', vim.env.MASON .. '/packages/jdtls/config_linux', - -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^ - -- Must point to the Change to one of `linux`, `win` or `mac` - -- eclipse.jdt.ls installation Depending on your system. - - - -- ๐Ÿ’€ - -- See `data directory configuration` section in the README - '-data', vim.env.XDG_CACHE_HOME .. '/jdtls/' .. project_name - }, - - -- ๐Ÿ’€ - -- This is the default if not provided, you can remove it. Or adjust as needed. - -- One dedicated LSP server & client will be started per unique root_dir - -- - -- vim.fs.root requires Neovim 0.10. - -- If you're using an earlier version, use: require('jdtls.setup').find_root({'.git', 'mvnw', 'gradlew'}), - root_dir = root_dir, - - -- Here you can configure eclipse.jdt.ls specific settings - -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request - -- for a list of options - settings = { - -- java.configuration.maven.userSettings - java = { - configuration = { - jdt = { - ls = { - lombokSupport = { enabled = false } - } - }, - maven = { - userSettings = root_dir .. '/maven-settings-local.xml' - } - } - } - }, - - -- Language server `initializationOptions` - -- You need to extend the `bundles` with paths to jar files - -- if you want to use additional eclipse.jdt.ls plugins. - -- - -- See https://github.com/mfussenegger/nvim-jdtls#java-debug-installation - -- - -- If you don't plan on using the debugger or other eclipse.jdt.ls plugins you can remove this - init_options = { - bundles = bundles, - }, -} --- This starts a new client & server, --- or attaches to an existing client & server depending on the `root_dir`. -require('jdtls').start_or_attach(config) - -vim.api.nvim_create_user_command('JdtTestClass', require 'jdtls'.test_class, {desc='Test Class'}) -vim.api.nvim_create_user_command('JdtTestMethod', require 'jdtls'.test_nearest_method, {desc='Test Nearest Method'}) -vim.api.nvim_create_user_command('JdtTestPick', require 'jdtls'.pick_test, {desc = 'Pick Test'}) diff --git a/ftplugin/lua.lua b/ftplugin/lua.lua @@ -1,36 +0,0 @@ -vim.bo.efm = [[lua: %f:%l: %m]] -vim.bo.makeprg = [[lua %:S]] -vim.bo.shiftwidth = 2 - -vim.keymap.set('n', '<leader>ar', vim.cmd.make) - -if pcall(require, 'lazydev') then - require 'lazydev'.setup() -end - --- vim.lsp.start { --- name = 'lua-language-server', --- cmd = { 'lua-language-server' }, --- capabilities = require 'tms.lsp'.capabilities(), --- root_dir = vim.fn.getcwd(), --- settings = { --- Lua = { --- runtime = { version = 'LuaJIT' }, --- diagnostics = { --- -- --- globals = { 'vim' }, --- disable = { 'missing-parameter' }, --- }, --- telemetry = { enable = false }, --- workspace = { --- checkThirdParty = false, --- -- slow compared to neodev --- -- library = vim.api.nvim_get_runtime_file('', true), --- -- library = { vim.env.VIMRUNTIME }, --- }, --- completion = { callSnippet = 'Replace' }, --- }, --- }, --- } - -vim.api.nvim_set_hl(0, '@lsp.mod.defaultLibrary.lua', { link = 'Special' }) diff --git a/ftplugin/mail.lua b/ftplugin/mail.lua @@ -1,3 +0,0 @@ -vim.opt.spell = true -vim.opt.spelllang = { 'cs', 'csa', 'en' } -vim.keymap.set('n', '<leader>aa', require 'tms.p.telescope'.mail_address, { buffer = true }) diff --git a/ftplugin/scheme.lua b/ftplugin/scheme.lua @@ -1 +0,0 @@ -vim.opt.filetype = 'query' diff --git a/ftplugin/sh.lua b/ftplugin/sh.lua @@ -1,8 +0,0 @@ -vim.bo.makeprg = [[sh %:S]] -vim.bo.efm = [[%f: line %l: %m]] -vim.bo.expandtab = false - -local cmp = require('cmp') -cmp.setup.buffer { sources = { { name = 'nvim_lsp' }, { name = 'exe' }, { name = 'path' } } } - -vim.keymap.set('n', '<leader>ar', vim.cmd.make, { buffer = true }) diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua @@ -1,2 +0,0 @@ --- vim.cmd.compiler "zig" -vim.treesitter.start(0, "zig") diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua @@ -1,26 +0,0 @@ -vim.bo.makeprg = [[zsh -n -- %:S]] -vim.bo.efm = [[%f:%l: %m,%f: line %l: %m, %-G%.%#]] -vim.bo.expandtab = false - -if pcall(require, 'cmp') then - require 'cmp'.setup.buffer { - -- completion = { autocomplete = false }, - sources = { - -- - { name = 'zsh' }, - { name = 'nvim_lsp' }, - { name = 'exe' }, - { name = 'path' }, - }, - } -end - -vim.keymap.set('n', '<leader>ar', function() - local tms_prg = vim.bo.makeprg - local tms_efm = vim.bo.efm - vim.bo.makeprg = [[./%]] - vim.bo.efm = [[%f:%.%#:%l:\ %m,%f:%l:\ %m,%-G%.%#]] - vim.cmd.make() - vim.bo.makeprg = tms_prg - vim.bo.efm = tms_efm -end, { buffer = true }) diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -42,7 +42,7 @@ return require('paq') { 'tpope/vim-fugitive', 'ThePrimeagen/git-worktree.nvim', 'rhysd/conflict-marker.vim', - { 'rest-nvim/rest.nvim', requires = { 'nvim-lua/plenary.nvim' }, opt = true }, + { 'rest-nvim/rest.nvim', requires = { 'nvim-lua/plenary.nvim' }, opt = true }, 'tikhomirov/vim-glsl', 'windwp/nvim-ts-autotag', 'baskerville/vim-sxhkdrc', @@ -109,10 +109,10 @@ return require('paq') { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim', 'kyazdani42/nvim-web-devicons' }, }, - 'nvim-telescope/telescope-fzy-native.nvim', + { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, 'nvim-telescope/telescope-dap.nvim', - { 'aaronhallaert/advanced-git-search.nvim', requires = { 'tpope/vim-fugitive' } }, + { 'aaronhallaert/advanced-git-search.nvim', requires = { 'tpope/vim-fugitive' } }, 'habamax/vim-godot', 'codethread/qmk.nvim', 'elkowar/yuck.vim', diff --git a/lua/tms/p/telescope.lua b/lua/tms/p/telescope.lua @@ -1,28 +0,0 @@ -local M = {} - -function M.mail_address() - local actions = require('telescope.actions') - local action_set = require('telescope.actions.set') - local action_state = require('telescope.actions.state') - local pickers = require('telescope.pickers') - local finders = require('telescope.finders') - local sorters = require('telescope.sorters') - - pickers.new { - results_title = 'Adresses', - finder = finders.new_oneshot_job({ 'khard', 'email', '--parsable', '--remove-first-line' }), - sorter = sorters.get_fuzzy_file(), - attach_mappings = function(_) - action_set.select:replace(function(prompt_bufnr, _) - local entry = action_state.get_selected_entry() - local mail, name = entry.value:match('([^\t]+)\t([^\t]+)') - actions.close(prompt_bufnr) - vim.fn.setreg('+', name .. ' <' .. mail .. '>') - vim.fn.setreg('*', name .. ' <' .. mail .. '>') - end) - return true - end, - }:find() -end - -return M diff --git a/lua/tms/p/telescope/init.lua b/lua/tms/p/telescope/init.lua @@ -0,0 +1,4 @@ +return { + mail_address = require 'tms.p.telescope.mail_address'.mail_address, + multigrep = require 'tms.p.telescope.multigrep'.multigrep +} diff --git a/lua/tms/p/telescope/mail_address.lua b/lua/tms/p/telescope/mail_address.lua @@ -0,0 +1,30 @@ +local M = {} + +function M.mail_address(opts) + opts = opts or {} + + local actions = require('telescope.actions') + local action_set = require('telescope.actions.set') + local action_state = require('telescope.actions.state') + local pickers = require('telescope.pickers') + local finders = require('telescope.finders') + local sorters = require('telescope.sorters') + + pickers.new(opts, { + results_title = 'Adresses', + finder = finders.new_oneshot_job({ 'khard', 'email', '--parsable', '--remove-first-line' }, opts), + sorter = sorters.get_fuzzy_file(), + attach_mappings = function(_) + action_set.select:replace(function(prompt_bufnr, _) + local entry = action_state.get_selected_entry() + local mail, name = entry.value:match('([^\t]+)\t([^\t]+)') + actions.close(prompt_bufnr) + vim.fn.setreg('+', name .. ' <' .. mail .. '>') + vim.fn.setreg('*', name .. ' <' .. mail .. '>') + end) + return true + end, + }):find() +end + +return M diff --git a/lua/tms/p/telescope/multigrep.lua b/lua/tms/p/telescope/multigrep.lua @@ -0,0 +1,53 @@ +local M = {} + +local pickers = require 'telescope.pickers' +local finders = require 'telescope.finders' +local make_entry = require 'telescope.make_entry' +local conf = require 'telescope.config'.values + +function M.multigrep(opts) + opts = opts or {} + opts.cwd = opts.cwd or vim.uv.cwd() + + local finder = finders.new_async_job { + command_generator = function(prompt) + if not prompt or prompt == "" then + return nil + end + + local pieces = vim.split(prompt, " ") + local args = { "rg" } + if pieces[1] then + table.insert(args, "-e") + table.insert(args, pieces[1]) + end + + if pieces[2] then + table.insert(args, "-g") + table.insert(args, pieces[2]) + end + + return + ---@diagnostic disable-next-line: deprecated + vim.tbl_flatten { + args, + { + "--color=never", + "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" + } + } + end, + entry_maker = make_entry.gen_from_vimgrep(opts), + cwd = opts.cwd, + } + + pickers.new(opts, { + debounce = 100, + prompt_title = "Multi Grep", + finder = finder, + previewer = conf.grep_previewer(opts), + sorter = require('telescope.sorters').empty(), + }):find() +end + +return M diff --git a/plugin/options.lua b/plugin/options.lua @@ -1,41 +1,43 @@ -vim.opt.exrc = true -vim.opt.clipboard = 'unnamedplus' -vim.opt.completeopt = 'menu,menuone,noselect,noinsert' +local set = vim.opt +set.exrc = true +set.clipboard = 'unnamedplus' +set.completeopt = 'menu,menuone,noselect,noinsert' -- vim.opt.equalalways = false -- exp -vim.opt.grepprg = 'rg --vimgrep --no-heading --smart-case --ignore-case' -vim.opt.grepformat = '%f:%l:%c:%m' -vim.opt.formatoptions:append('o') -vim.opt.formatoptions:append('r') -vim.opt.ignorecase = true -- use `/C` to force case -vim.opt.inccommand = 'split' -vim.opt.pumheight = 5 +set.grepprg = 'rg --vimgrep --no-heading --smart-case --ignore-case' +set.grepformat = '%f:%l:%c:%m' +set.formatoptions:append('o') +set.formatoptions:append('r') +set.ignorecase = true -- use `/C` to force case +set.inccommand = 'split' +set.pumheight = 5 -- vim.opt.shortmess = vim.opt.shortmess + 'c' -- exp -vim.opt.showbreak = '>\\' -vim.opt.showmode = false -vim.opt.smartcase = true -vim.opt.splitbelow = true -vim.opt.splitright = true -vim.opt.termguicolors = true -vim.opt.updatetime = 100 -vim.opt.expandtab = true -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 +set.showbreak = '>\\' +set.showmode = false +set.smartcase = true +set.splitbelow = true +set.splitright = true +set.termguicolors = true +set.updatetime = 100 +set.expandtab = true +set.tabstop = 2 +set.shiftwidth = 2 -- vim.opt.softtabstop = -1 -- exp -vim.opt.smartindent = true -vim.opt.breakindent = true -vim.opt.swapfile = false -vim.opt.undofile = true -vim.opt.laststatus = 3 -vim.opt.statusline = ' ' +set.smartindent = true +set.backupdir = vim.env.XDG_STATE_HOME .. "/nvim/backup//" +set.breakindent = true +-- set.swapfile = false +set.undofile = true +set.laststatus = 3 +set.statusline = ' ' -- its nice but when: -- * changing qf-item there is entr-prompt -- vim.opt.cmdheight = 0 -vim.opt.winbar = '%=%m %f' -vim.opt.ruler = false -vim.opt.listchars = { space = 'ยท', tab = 'ยป ', extends = 'โ€บ', precedes = 'โ€น', nbsp = '_', trail = '_', eol = '$' } -vim.opt.fillchars = { eob = 'โ€ข', diff = 'โ•ฑ', fold = 'โ€ข' } -vim.opt.scrolloff = 5 -vim.opt.sidescrolloff = 5 -vim.opt.signcolumn = 'yes:1' -vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()' -vim.opt.foldtext = '' +set.winbar = '%=%m %f' +set.ruler = false +set.listchars = { space = 'ยท', tab = 'ยป ', extends = 'โ€บ', precedes = 'โ€น', nbsp = '_', trail = '_', eol = '$' } +set.fillchars = { eob = 'โ€ข', diff = 'โ•ฑ', fold = 'โ€ข' } +set.scrolloff = 5 +set.sidescrolloff = 5 +set.signcolumn = 'yes:1' +set.foldexpr = 'v:lua.vim.treesitter.foldexpr()' +set.foldtext = ''