diff --git a/nvim/lua/lsp.lua b/nvim/lua/lsp.lua index 301ee58..c3add5e 100644 --- a/nvim/lua/lsp.lua +++ b/nvim/lua/lsp.lua @@ -2,9 +2,9 @@ -- top-level -------------------------------------------------------------------------------- require("mason").setup({ - ui = { - border = "single", - }, + ui = { + border = "single", + }, }) local capabilities_cmp = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) @@ -17,9 +17,9 @@ vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { -- diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - virtual_text = false, - signs = true, - update_in_insert = true, + virtual_text = false, + signs = true, + update_in_insert = true, }) -- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( @@ -37,36 +37,39 @@ local mapx = require("mapx") -- map('i', '', 'pumvisible() ? \"\\" : \"\\"', {expr = true}) local on_attach = function(_, _) - local options = { silent = true, buffer = true } + local options = { silent = true, buffer = true } - mapx.nnoremap("K", function() - vim.lsp.buf.hover() - end, options) - mapx.nnoremap("gD", function() - vim.lsp.buf.declaration() - end, options) - mapx.nnoremap("gd", function() - vim.lsp.buf.definition() - end, options) - mapx.nnoremap("gi", function() - vim.lsp.buf.implementation() - end, options) - mapx.nnoremap("", function() - vim.lsp.buf.code_action() - end, options) - -- mapx.nnoremap('', function() vim.lsp.buf.signature_help() end, options) - mapx.nnoremap("f", function() - vim.lsp.buf.format() - end, options) - mapx.nnoremap("r", function() - vim.lsp.buf.rename() - end) - mapx.nnoremap("", function() - vim.diagnostic.goto_next({ popup_opts = { border = "single" } }) - end, options) - mapx.nnoremap("", function() - vim.diagnostic.goto_prev({ popup_opts = { border = "single" } }) - end, options) + mapx.nnoremap("K", function() + vim.lsp.buf.hover() + end, options) + mapx.nnoremap("gD", function() + vim.lsp.buf.declaration() + end, options) + mapx.nnoremap("gd", function() + vim.lsp.buf.definition() + end, options) + mapx.nnoremap("gi", function() + vim.lsp.buf.implementation() + end, options) + mapx.nnoremap("", function() + vim.lsp.buf.code_action() + end, options) + -- mapx.nnoremap('', function() vim.lsp.buf.signature_help() end, options) + mapx.nnoremap("f", function() + vim.lsp.buf.format() + end, options) + mapx.nnoremap("r", function() + vim.lsp.buf.rename() + end) + mapx.nnoremap("a", function() + vim.lsp.buf.code_action() + end) + mapx.nnoremap("", function() + vim.diagnostic.goto_next({ popup_opts = { border = "single" } }) + end, options) + mapx.nnoremap("", function() + vim.diagnostic.goto_prev({ popup_opts = { border = "single" } }) + end, options) end -------------------------------------------------------------------------------- @@ -79,74 +82,74 @@ vim.cmd("set shortmess+=c") local cmp = require("cmp") cmp.setup({ - snippet = { - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) - end, - }, - mapping = { - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm({ select = false }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "vsnip" }, - { name = "buffer" }, - }, - window = { - documentation = { - maxheight = 50, - }, + snippet = { + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) + end, + }, + mapping = { + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ select = false }), + }, + sources = { + { name = "nvim_lsp" }, + { name = "vsnip" }, + { name = "buffer" }, + }, + window = { + documentation = { + maxheight = 50, }, + }, }) -------------------------------------------------------------------------------- -- json -------------------------------------------------------------------------------- local options_json = { - on_attach = on_attach, - capabilities = capabilities_cmp, + on_attach = on_attach, + capabilities = capabilities_cmp, } -------------------------------------------------------------------------------- -- html -------------------------------------------------------------------------------- local options_html = { - on_attach = on_attach, - capabilities = capabilities_cmp, + on_attach = on_attach, + capabilities = capabilities_cmp, } -------------------------------------------------------------------------------- -- python -------------------------------------------------------------------------------- local options_pyright = { - on_attach = on_attach, - capabilities = capabilities_cmp, - settings = { - pyright = { - disableLanguageServices = true - } - } + on_attach = on_attach, + capabilities = capabilities_cmp, + settings = { + pyright = { + disableLanguageServices = true, + }, + }, } local options_python = { - on_attach = on_attach, - capabilities = capabilities_cmp, - settings = { - pylsp = { - plugins = { - pycodestyle = { enabled = false }, - pyflakes = { enabled = false }, - yapf = { enabled = false }, - flake8 = { enabled = true }, - }, - }, + on_attach = on_attach, + capabilities = capabilities_cmp, + settings = { + pylsp = { + plugins = { + pycodestyle = { enabled = false }, + pyflakes = { enabled = false }, + yapf = { enabled = false }, + flake8 = { enabled = true }, + }, }, + }, } -------------------------------------------------------------------------------- @@ -154,22 +157,22 @@ local options_python = { -------------------------------------------------------------------------------- -- https://sharksforarms.dev/posts/neovim-rust/ local options_rust = { - on_attach = on_attach, - capabilities = capabilities_cmp, - settings = { - ["rust-analyzer"] = { - assist = { - importMergeBehavior = "last", - importPrefix = "by_self", - }, - cargo = { - loadOutDirsFromCheck = true, - }, - procMacro = { - enable = true, - }, - }, + on_attach = on_attach, + capabilities = capabilities_cmp, + settings = { + ["rust-analyzer"] = { + assist = { + importMergeBehavior = "last", + importPrefix = "by_self", + }, + cargo = { + loadOutDirsFromCheck = true, + }, + procMacro = { + enable = true, + }, }, + }, } -------------------------------------------------------------------------------- @@ -181,48 +184,48 @@ local sumneko_root_path = "" local sumneko_binary = "" sumneko_binary = "/Users/" - .. USER - .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server" + .. USER + .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server/bin/lua-language-server" sumneko_root_path = "/Users/" .. USER .. "/.local/share/nvim/lsp_servers/sumneko_lua/extension/server" local options_lua = { - on_attach = on_attach, - cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" }, - capabilities = capabilities_cmp, - settings = { - Lua = { - runtime = { - version = "LuaJIT", - path = vim.split(package.path, ";"), - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, - }, - }, - format = { - enable = false, - }, + on_attach = on_attach, + cmd = { sumneko_binary, "-E", sumneko_root_path .. "/main.lua" }, + capabilities = capabilities_cmp, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = vim.split(package.path, ";"), + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true, }, + }, + format = { + enable = false, + }, }, + }, } -------------------------------------------------------------------------------- -- ruby -------------------------------------------------------------------------------- local options_ruby = { - on_attach = on_attach, - capabilities = capabilities_cmp, - settings = { - solargraph = { - diagnostics = true, - }, + on_attach = on_attach, + capabilities = capabilities_cmp, + settings = { + solargraph = { + diagnostics = true, }, + }, } -------------------------------------------------------------------------------- @@ -231,62 +234,60 @@ local options_ruby = { local lspconfig = require("lspconfig") require("mason-lspconfig").setup_handlers({ - function(server_name) - lspconfig[server_name].setup({}) - end, - ["sumneko_lua"] = function() - lspconfig.sumneko_lua.setup(options_lua) - end, - ["solargraph"] = function() - lspconfig.solargraph.setup(options_ruby) - end, - ["pyright"] = function() - lspconfig.pyright.setup(options_pyright) - end, - ["html"] = function() - lspconfig.html.setup(options_html) - end, - ["jsonls"] = function() - lspconfig.jsonls.setup(options_json) - end, - ["rust_analyzer"] = function() - lspconfig.rust_analyzer.setup(options_rust) - end, - ["efm"] = function() - lspconfig.efm.setup({ - init_options = { - documentFormatting = true, + function(server_name) + lspconfig[server_name].setup({}) + end, + ["sumneko_lua"] = function() + lspconfig.sumneko_lua.setup(options_lua) + end, + ["solargraph"] = function() + lspconfig.solargraph.setup(options_ruby) + end, + ["pyright"] = function() + lspconfig.pyright.setup(options_pyright) + end, + ["html"] = function() + lspconfig.html.setup(options_html) + end, + ["jsonls"] = function() + lspconfig.jsonls.setup(options_json) + end, + ["rust_analyzer"] = function() + lspconfig.rust_analyzer.setup(options_rust) + end, + ["efm"] = function() + lspconfig.efm.setup({ + init_options = { + documentFormatting = true, + }, + settings = { + rootMarkers = { ".git/" }, + languages = { + lua = { + { formatCommand = "stylua -", formatStdin = true }, + }, + python = { + { + formatCommand = "black --quiet -", + formatStdin = true, }, - settings = { - rootMarkers = { ".git/" }, - languages = { - lua = { - { formatCommand = "stylua --indent-type=spaces -", formatStdin = true }, - }, - python = { - { - formatCommand = "black --quiet -", - formatStdin = true, - }, - { - formatCommand = "isort --quiet -", - formatStdin = true, - }, - { - lintCommand = "flake8 -", - lintStdin = true, - lintFormats = {"%f:%l:%c: %m"} - } - - }, - yaml = { { formatCommand = "prettierd -", formatStdin = true } }, - html = { { formatCommand = "prettierd -", formatStdin = true } }, - css = { { formatCommand = "prettierd -", formatStdin = true } }, - json = { { formatCommand = "prettier -", formatStdin = true } }, - - }, + { + formatCommand = "isort --quiet -", + formatStdin = true, }, - filetypes = { "lua", "python" }, - }) - end, + { + lintCommand = "flake8 -", + lintStdin = true, + lintFormats = { "%f:%l:%c: %m" }, + }, + }, + yaml = { { formatCommand = "prettierd -", formatStdin = true } }, + html = { { formatCommand = "prettierd -", formatStdin = true } }, + css = { { formatCommand = "prettierd -", formatStdin = true } }, + json = { { formatCommand = "prettier -", formatStdin = true } }, + }, + }, + filetypes = { "lua", "python", "yaml", "html", "css", "json" }, + }) + end, }) diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua index 9cc7553..f263f07 100644 --- a/nvim/lua/mappings.lua +++ b/nvim/lua/mappings.lua @@ -21,13 +21,13 @@ mapx.vnoremap("", "gc", "silent") -- telescope local telescope = require("telescope.builtin") mapx.nnoremap("ff", function() - telescope.find_files() + telescope.find_files() end, "silent") mapx.nnoremap("fg", function() - telescope.live_grep() + telescope.live_grep() end, "silent") mapx.nnoremap("gr", function() - telescope.lsp_references() + telescope.lsp_references() end, "silent") -- misc diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua index be1718a..1371e3c 100644 --- a/nvim/lua/options.lua +++ b/nvim/lua/options.lua @@ -2,10 +2,10 @@ local cmd = vim.cmd local scopes = { o = vim.o, b = vim.bo, w = vim.wo } local function opt(scope, key, value) - scopes[scope][key] = value - if scope ~= "o" then - scopes["o"][key] = value - end + scopes[scope][key] = value + if scope ~= "o" then + scopes["o"][key] = value + end end opt("o", "termguicolors", true) @@ -33,16 +33,16 @@ opt("o", "inccommand", "nosplit") -- disable unused stuff local disabled_built_ins = { - "netrwFileHandlers", - "gzip", - "zip", - "zipPlugin", - "tar", - "tarPlugin", - "spellfile_plugin", - "tutor", + "netrwFileHandlers", + "gzip", + "zip", + "zipPlugin", + "tar", + "tarPlugin", + "spellfile_plugin", + "tutor", } for _, plugin in pairs(disabled_built_ins) do - vim.g["loaded_" .. plugin] = 1 + vim.g["loaded_" .. plugin] = 1 end diff --git a/nvim/lua/packer_plugins.lua b/nvim/lua/packer_plugins.lua index 291889e..a8b4a44 100644 --- a/nvim/lua/packer_plugins.lua +++ b/nvim/lua/packer_plugins.lua @@ -1,156 +1,156 @@ return require("packer").startup({ - function(use) - use("wbthomason/packer.nvim") + function(use) + use("wbthomason/packer.nvim") - -- appearance - use({ - "jsstevenson/tokyonight.nvim", - branch = "new-colors", - }) - use({ - "hoob3rt/lualine.nvim", - config = function() - require("plugins.status_line") - end, - }) - use({ - "akinsho/nvim-bufferline.lua", - config = function() - require("bufferline").setup({}) - end, - }) - use("voldikss/vim-floaterm") - use({ - "mechatroner/rainbow_csv", - ft = { "csv", "tsv" }, - }) - use({ - "rrethy/vim-hexokinase", - run = "cd ~/.local/share/nvim/site/pack/packer/start/vim-hexokinase && make hexokinase", - }) + -- appearance + use({ + "jsstevenson/tokyonight.nvim", + branch = "new-colors", + }) + use({ + "hoob3rt/lualine.nvim", + config = function() + require("plugins.status_line") + end, + }) + use({ + "akinsho/nvim-bufferline.lua", + config = function() + require("bufferline").setup({}) + end, + }) + use("voldikss/vim-floaterm") + use({ + "mechatroner/rainbow_csv", + ft = { "csv", "tsv" }, + }) + use({ + "rrethy/vim-hexokinase", + run = "cd ~/.local/share/nvim/site/pack/packer/start/vim-hexokinase && make hexokinase", + }) - -- general - use({ - "b0o/mapx.nvim", - config = function() - require("mapx").setup({}) - end, - }) + -- general + use({ + "b0o/mapx.nvim", + config = function() + require("mapx").setup({}) + end, + }) - -- telescope - use({ - "nvim-telescope/telescope.nvim", - requires = { - { "nvim-lua/plenary.nvim" }, - { - "nvim-telescope/telescope-fzf-native.nvim", - run = "make", - }, - }, - config = function() - require("plugins.telescope") - end, - }) + -- telescope + use({ + "nvim-telescope/telescope.nvim", + requires = { + { "nvim-lua/plenary.nvim" }, + { + "nvim-telescope/telescope-fzf-native.nvim", + run = "make", + }, + }, + config = function() + require("plugins.telescope") + end, + }) - -- text objects & formatting - -- use 'wellle/targets.vim' - -- use 'michaeljsmith/vim-indent-object' - use({ - "Vimjas/vim-python-pep8-indent", - ft = { "python" }, - }) - -- try https://github.com/junegunn/vim-easy-align as well? - use({ - "godlygeek/tabular", - ft = { "tex", "markdown" }, - }) - use({ - "numToStr/Comment.nvim", - config = function() - require("Comment").setup() - end, - }) - use("tpope/vim-surround") - use("jiangmiao/auto-pairs") - use({ - "jpalardy/vim-slime", - -- ft = {'python', 'racket', 'javascript', 'javascriptreact'}, - config = function() - require("plugins.slime") - end, - }) + -- text objects & formatting + -- use 'wellle/targets.vim' + -- use 'michaeljsmith/vim-indent-object' + use({ + "Vimjas/vim-python-pep8-indent", + ft = { "python" }, + }) + -- try https://github.com/junegunn/vim-easy-align as well? + use({ + "godlygeek/tabular", + ft = { "tex", "markdown" }, + }) + use({ + "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end, + }) + use("tpope/vim-surround") + use("jiangmiao/auto-pairs") + use({ + "jpalardy/vim-slime", + -- ft = {'python', 'racket', 'javascript', 'javascriptreact'}, + config = function() + require("plugins.slime") + end, + }) - -- treesitter stuff - use({ - "nvim-treesitter/nvim-treesitter", - }) - use({ - "RRethy/nvim-treesitter-endwise", - }) - use({ - "windwp/nvim-ts-autotag", - }) - use({ - "nvim-treesitter/playground", - }) + -- treesitter stuff + use({ + "nvim-treesitter/nvim-treesitter", + }) + use({ + "RRethy/nvim-treesitter-endwise", + }) + use({ + "windwp/nvim-ts-autotag", + }) + use({ + "nvim-treesitter/playground", + }) - -- LSP things - use({ - "neovim/nvim-lspconfig", - requires = { - { "hrsh7th/cmp-nvim-lsp" }, - { "hrsh7th/cmp-buffer" }, - { "hrsh7th/nvim-cmp" }, - { "hrsh7th/vim-vsnip" }, - { "hrsh7th/vim-vsnip-integ" }, - { "williamboman/mason.nvim" }, - { "williamboman/mason-lspconfig.nvim" }, - }, - }) + -- LSP things + use({ + "neovim/nvim-lspconfig", + requires = { + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/cmp-buffer" }, + { "hrsh7th/nvim-cmp" }, + { "hrsh7th/vim-vsnip" }, + { "hrsh7th/vim-vsnip-integ" }, + { "williamboman/mason.nvim" }, + { "williamboman/mason-lspconfig.nvim" }, + }, + }) - -- git - use("itchyny/vim-gitbranch") -- until I feel better about vim-fugitive - use({ - "rhysd/conflict-marker.vim", - config = function() - require("plugins.conflict_marker") - end, - }) - use({ - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - end, - }) + -- git + use("itchyny/vim-gitbranch") -- until I feel better about vim-fugitive + use({ + "rhysd/conflict-marker.vim", + config = function() + require("plugins.conflict_marker") + end, + }) + use({ + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }) - -- language-specific - use({ - "nicwest/vim-http", - ft = { "http" }, - }) - use({ - "wlangstroth/vim-racket", - ft = { "racket" }, - }) - use({ - "rust-lang/rust.vim", - ft = { "rust" }, - }) - use({ - "lervag/vimtex", - ft = { "tex" }, - }) - use({ - "NTBBloodbath/rest.nvim", - requires = { "nvim-lua/plenary.nvim" }, - config = function() - require("plugins.nvim-rest") - end, - }) - end, - config = { - display = { - open_fn = require("packer.util").float, - }, + -- language-specific + use({ + "nicwest/vim-http", + ft = { "http" }, + }) + use({ + "wlangstroth/vim-racket", + ft = { "racket" }, + }) + use({ + "rust-lang/rust.vim", + ft = { "rust" }, + }) + use({ + "lervag/vimtex", + ft = { "tex" }, + }) + use({ + "NTBBloodbath/rest.nvim", + requires = { "nvim-lua/plenary.nvim" }, + config = function() + require("plugins.nvim-rest") + end, + }) + end, + config = { + display = { + open_fn = require("packer.util").float, }, + }, }) diff --git a/nvim/lua/plugins/nvim-rest.lua b/nvim/lua/plugins/nvim-rest.lua index 41d062a..920d588 100644 --- a/nvim/lua/plugins/nvim-rest.lua +++ b/nvim/lua/plugins/nvim-rest.lua @@ -1,24 +1,24 @@ require("rest-nvim").setup({ - -- Open request results in a horizontal split - result_split_horizontal = false, - -- Keep the http file buffer above|left when split horizontal|vertical - result_split_in_place = false, - -- Skip SSL verification, useful for unknown certificates - skip_ssl_verification = false, - -- Highlight request on run - highlight = { - enabled = true, - timeout = 150, - }, - result = { - -- toggle showing URL, HTTP info, headers at top the of result window - show_url = true, - show_http_info = true, - show_headers = true, - }, - -- Jump to request line on run - jump_to_request = false, - env_file = ".env", - custom_dynamic_variables = {}, - yank_dry_run = true, + -- Open request results in a horizontal split + result_split_horizontal = false, + -- Keep the http file buffer above|left when split horizontal|vertical + result_split_in_place = false, + -- Skip SSL verification, useful for unknown certificates + skip_ssl_verification = false, + -- Highlight request on run + highlight = { + enabled = true, + timeout = 150, + }, + result = { + -- toggle showing URL, HTTP info, headers at top the of result window + show_url = true, + show_http_info = true, + show_headers = true, + }, + -- Jump to request line on run + jump_to_request = false, + env_file = ".env", + custom_dynamic_variables = {}, + yank_dry_run = true, }) diff --git a/nvim/lua/plugins/status_line.lua b/nvim/lua/plugins/status_line.lua index 5a381b8..f00cd3b 100644 --- a/nvim/lua/plugins/status_line.lua +++ b/nvim/lua/plugins/status_line.lua @@ -1,27 +1,27 @@ local present, lualine = pcall(require, "lualine") if not present then - return + return end local function environment_name() - local ps1 = os.getenv("PS1") - if ps1 then - return string.match(ps1, "%((.+)%) ") - else - return "" - end + local ps1 = os.getenv("PS1") + if ps1 then + return string.match(ps1, "%((.+)%) ") + else + return "" + end end lualine.setup({ - options = { - theme = "tokyonight", - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { environment_name }, - lualine_x = { "encoding" }, - lualine_y = { "filetype" }, - lualine_z = { "filename" }, - }, + options = { + theme = "tokyonight", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { environment_name }, + lualine_x = { "encoding" }, + lualine_y = { "filetype" }, + lualine_z = { "filename" }, + }, }) diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index f182f3d..5f6d1dd 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -2,27 +2,27 @@ local previewers = require("telescope.previewers") local actions = require("telescope.actions") require("telescope").setup({ - defaults = { - file_sorter = require("telescope.sorters").get_fzy_sorter, - prompt_prefix = " >", - file_previewer = previewers.vim_buffer_cat.new, - grep_previewer = previewers.vim_buffer_vimgrep.new, - mappings = { - i = { - [""] = false, - [""] = false, - [""] = actions.close, - }, - }, - layout_strategy = "vertical", - file_ignore_patterns = { - "node_modules", - "site-packages", - }, + defaults = { + file_sorter = require("telescope.sorters").get_fzy_sorter, + prompt_prefix = " >", + file_previewer = previewers.vim_buffer_cat.new, + grep_previewer = previewers.vim_buffer_vimgrep.new, + mappings = { + i = { + [""] = false, + [""] = false, + [""] = actions.close, + }, }, - -- pickers = { - -- builtin.treesitter - -- } + layout_strategy = "vertical", + file_ignore_patterns = { + "node_modules", + "site-packages", + }, + }, + -- pickers = { + -- builtin.treesitter + -- } }) require("telescope").load_extension("fzf") diff --git a/nvim/lua/treesitter.lua b/nvim/lua/treesitter.lua index 145e189..915fd46 100644 --- a/nvim/lua/treesitter.lua +++ b/nvim/lua/treesitter.lua @@ -1,62 +1,62 @@ local ts = require("nvim-treesitter.configs") ts.setup({ - ensure_installed = { - "bash", - "bibtex", - "c", - "cpp", - "graphql", - "html", - "java", - "javascript", - "jsdoc", - "json", - "jsonc", - "julia", - "lua", - "python", - "ruby", - "rust", - "sparql", - "toml", - "tsx", - "typescript", - "yaml", - "query", + ensure_installed = { + "bash", + "bibtex", + "c", + "cpp", + "graphql", + "html", + "java", + "javascript", + "jsdoc", + "json", + "jsonc", + "julia", + "lua", + "python", + "ruby", + "rust", + "sparql", + "toml", + "tsx", + "typescript", + "yaml", + "query", + }, + highlight = { enable = true, disable = { "tex", "html" } }, + indent = { enable = true, disable = { "rust", "lua", "python", "ruby" } }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + scope_incremental = "", + node_incremental = "", + node_decremental = "", }, - highlight = { enable = true, disable = { "tex", "html" } }, - indent = { enable = true, disable = { "rust", "lua", "python", "ruby" } }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - scope_incremental = "", - node_incremental = "", - node_decremental = "", - }, - }, - endwise = { - enable = true, - }, - autotag = { - enable = true, - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = "o", - toggle_hl_groups = "i", - toggle_injected_languages = "t", - toggle_anonymous_nodes = "a", - toggle_language_display = "I", - focus_language = "f", - unfocus_language = "F", - update = "R", - goto_node = "", - show_help = "?", - }, + }, + endwise = { + enable = true, + }, + autotag = { + enable = true, + }, + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false, -- Whether the query persists across vim sessions + keybindings = { + toggle_query_editor = "o", + toggle_hl_groups = "i", + toggle_injected_languages = "t", + toggle_anonymous_nodes = "a", + toggle_language_display = "I", + focus_language = "f", + unfocus_language = "F", + update = "R", + goto_node = "", + show_help = "?", }, + }, }) diff --git a/nvim/lua/utils.lua b/nvim/lua/utils.lua index 2852ea8..b3c8912 100644 --- a/nvim/lua/utils.lua +++ b/nvim/lua/utils.lua @@ -2,11 +2,11 @@ local cmd = vim.cmd local api, g = vim.api, vim.g local function map(mode, lhs, rhs, opts) - local options = { noremap = true } - if opts then - options = vim.tbl_extend("force", options, opts) - end - api.nvim_set_keymap(mode, lhs, rhs, options) + local options = { noremap = true } + if opts then + options = vim.tbl_extend("force", options, opts) + end + api.nvim_set_keymap(mode, lhs, rhs, options) end -- terminal diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 0000000..0435f67 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,2 @@ +indent_type = "Spaces" +indent_width = 2