aboutsummaryrefslogtreecommitdiff
path: root/neovim/.config/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'neovim/.config/nvim/lua')
-rw-r--r--neovim/.config/nvim/lua/autocmd.lua25
-rw-r--r--neovim/.config/nvim/lua/keybinds.lua34
-rw-r--r--neovim/.config/nvim/lua/plugins.lua149
-rw-r--r--neovim/.config/nvim/lua/plugins/catppuccin.lua22
-rw-r--r--neovim/.config/nvim/lua/plugins/cmp.lua29
-rw-r--r--neovim/.config/nvim/lua/plugins/fidget.lua9
-rw-r--r--neovim/.config/nvim/lua/plugins/github-theme.lua4
-rw-r--r--neovim/.config/nvim/lua/plugins/gitsigns.lua27
-rw-r--r--neovim/.config/nvim/lua/plugins/lsp.lua79
-rw-r--r--neovim/.config/nvim/lua/plugins/lualine.lua34
-rw-r--r--neovim/.config/nvim/lua/plugins/mason.lua10
-rw-r--r--neovim/.config/nvim/lua/plugins/pairs.lua2
-rw-r--r--neovim/.config/nvim/lua/plugins/rust-tools.lua24
-rw-r--r--neovim/.config/nvim/lua/plugins/telescope.lua64
-rw-r--r--neovim/.config/nvim/lua/plugins/treesitter.lua126
-rw-r--r--neovim/.config/nvim/lua/settings.lua53
16 files changed, 691 insertions, 0 deletions
diff --git a/neovim/.config/nvim/lua/autocmd.lua b/neovim/.config/nvim/lua/autocmd.lua
new file mode 100644
index 0000000..603e6b4
--- /dev/null
+++ b/neovim/.config/nvim/lua/autocmd.lua
@@ -0,0 +1,25 @@
+-- Custom filetypes
+vim.filetype.add({
+ extension = {
+ conf = "conf",
+ nd = "markdown",
+ },
+ pattern = {
+ [".*%.env.*"] = "sh",
+ ["ignore$"] = "conf",
+ },
+})
+
+local cmd = vim.api.nvim_create_autocmd
+
+-- Go to last location when opening buffer
+cmd("BufReadPost", {
+ command = [[ if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g`\"" | endif ]]
+})
+
+-- Highlight the region on yank
+cmd("TextYankPost", {
+ group = vim.api.nvim_create_augroup("TextYankGroup", { clear = true }),
+ callback = function() vim.highlight.on_yank({ higroup = "Visual" }) end,
+})
+
diff --git a/neovim/.config/nvim/lua/keybinds.lua b/neovim/.config/nvim/lua/keybinds.lua
new file mode 100644
index 0000000..56834b2
--- /dev/null
+++ b/neovim/.config/nvim/lua/keybinds.lua
@@ -0,0 +1,34 @@
+map = function(m, k, v)
+ vim.keymap.set(m, k, v, { silent = true })
+end
+
+-- Fix * (Keep the cursor position, don't move to next match)
+map("n", "*", "*N")
+
+-- Fix n and N. Keeping cursor in center
+map("n", "n", "nzz")
+map("n", "N", "Nzz")
+
+-- Move line up and down in NORMAL and VISUAL modes
+map("n", "<A-j>", "<cmd>move .+1<cmd>")
+map("n", "<A-k>", "<cmd>move .-2<cr>")
+map("x", "<A-j>", ":move '>+1<cr>gv=gv")
+map("x", "<A-k>", ":move '<-2<cr>gv=gv")
+
+-- map("n", "<C-space>", ":Files<CR>")
+map("n", "<C-c>", ":!compile %<cr><cr>")
+
+-- Mimic shell movements
+-- map("i", "<C-E>", "<ESC>A")
+-- map("i", "<C-A>", "<ESC>I")
+
+-- Move to the next/previous buffer
+-- map("n", "<leader>[", "<CMD>bp<CR>")
+-- map("n", "<leader>]", "<CMD>bn<CR>")
+
+-- Move to last buffer
+-- map("n", """", "<CMD>b#<CR>")
+
+exp = {}
+exp.map = map
+
diff --git a/neovim/.config/nvim/lua/plugins.lua b/neovim/.config/nvim/lua/plugins.lua
new file mode 100644
index 0000000..5b28fbb
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins.lua
@@ -0,0 +1,149 @@
+-- Automatically run :PackerCompile whenever plugins.lua is updated with an autocommand:
+vim.api.nvim_create_autocmd("BufWritePost", {
+ group = vim.api.nvim_create_augroup("PACKER", { clear = true }),
+ pattern = "plugins.lua",
+ command = "source <afile> | PackerCompile",
+})
+
+return require("packer").startup(function(use)
+ use("wbthomason/packer.nvim")
+ use("nvim-lua/plenary.nvim")
+
+ -- Color theme
+ use({
+ "catppuccin/nvim",
+ as = "catppuccin-theme",
+ run = ":CatppuccinCompile",
+ config = function() require("plugins.catppuccin") end,
+ })
+
+ --[[ use({
+ "projekt0n/github-nvim-theme",
+ config = function() require("plugins.github-theme") end,
+ }) ]]
+
+ -- Status line
+ use({
+ {
+ "nvim-lualine/lualine.nvim",
+ event = "BufEnter",
+ config = function() require("plugins.lualine") end,
+ },
+ {
+ "j-hui/fidget.nvim",
+ after = "lualine.nvim",
+ config = function() require("plugins.fidget") end,
+ },
+ })
+
+ -- Better syntax highlighting
+ use({
+ {
+ "nvim-treesitter/nvim-treesitter",
+ event = "BufEnter",
+ config = function() require("plugins.treesitter") end,
+ },
+ {
+ "nvim-treesitter/playground",
+ after = "nvim-treesitter"
+ },
+ {
+ "nvim-treesitter/nvim-treesitter-refactor",
+ after = "nvim-treesitter"
+ },
+ {
+ "nvim-treesitter/nvim-treesitter-textobjects",
+ after = "nvim-treesitter"
+ },
+ })
+
+ -- Git features
+ use({
+ "lewis6991/gitsigns.nvim",
+ event = "BufEnter",
+ config = function() require("plugins.gitsigns") end,
+ })
+
+ -- Automatic bracket pars
+ use({
+ "windwp/nvim-autopairs",
+ event = "InsertCharPre",
+ after = "nvim-cmp",
+ config = function() require("plugins.pairs") end,
+ })
+
+ -- Comment utility
+ use({
+ "numToStr/Comment.nvim",
+ event = "BufEnter",
+ config = function() require("Comment").setup() end,
+ })
+
+ -- Fuzzy file picker
+ use({
+ {
+ "nvim-telescope/telescope.nvim",
+ config = function() require("plugins.telescope") end,
+ },
+ {
+ "nvim-telescope/telescope-fzf-native.nvim",
+ run = "make",
+ after = "telescope.nvim",
+ config = function() require("telescope").load_extension("fzf") end,
+ },
+ })
+
+ -- Language Server Protocol
+ use({
+ {
+ "neovim/nvim-lspconfig",
+ -- event = "BufEnter",
+ config = function() require("plugins.lsp") end,
+ },
+ {
+ "williamboman/mason-lspconfig.nvim",
+ after = "nvim-lspconfig",
+ },
+ {
+ "williamboman/mason.nvim",
+ after = "mason-lspconfig.nvim",
+ config = function() require("plugins.mason") end,
+ },
+ })
+
+ -- Completion framework
+ use({
+ {
+ "hrsh7th/nvim-cmp",
+ -- after = "nvim-lspconfig",
+ -- event = "BufEnter",
+ config = function() require("plugins.cmp") end,
+ },
+ {
+ "hrsh7th/cmp-nvim-lsp",
+ after = "nvim-cmp",
+ },
+ {
+ "hrsh7th/cmp-vsnip",
+ after = "nvim-cmp",
+ },
+ {
+ "hrsh7th/cmp-path",
+ after = "nvim-cmp",
+ },
+ {
+ "hrsh7th/cmp-buffer",
+ after = "nvim-cmp",
+ },
+ {
+ "hrsh7th/vim-vsnip",
+ after = "nvim-cmp",
+ },
+ })
+
+ use({
+ "simrat39/rust-tools.nvim",
+ after = "nvim-cmp",
+ config = function() require("plugins.rust-tools") end,
+ })
+end)
diff --git a/neovim/.config/nvim/lua/plugins/catppuccin.lua b/neovim/.config/nvim/lua/plugins/catppuccin.lua
new file mode 100644
index 0000000..e1780e3
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/catppuccin.lua
@@ -0,0 +1,22 @@
+vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
+local colors = require("catppuccin.palettes").get_palette() -- return vim.g.catppuccin_flavour palette
+
+require("catppuccin").setup({
+ transparent_background = true,
+ styles = {
+ comments = {},
+ conditionals = {},
+ },
+ integration = {
+ telescope = true,
+ },
+ highlight_overrides = {
+ all = {
+ CursorLine = { bg = colors.base },
+ CursorLineNr = { bg = colors.base },
+ },
+ },
+})
+
+vim.cmd([[ colorscheme catppuccin ]])
+
diff --git a/neovim/.config/nvim/lua/plugins/cmp.lua b/neovim/.config/nvim/lua/plugins/cmp.lua
new file mode 100644
index 0000000..18d8fe6
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/cmp.lua
@@ -0,0 +1,29 @@
+-- https://github.com/hrsh7th/nvim-cmp#basic-configuration
+local cmp = require('cmp')
+
+cmp.setup({
+ snippet = {
+ expand = function(args)
+ vim.fn["vsnip#anonymous"](args.body)
+ end,
+ },
+ mapping = {
+ ['<S-Tab>'] = cmp.mapping.select_prev_item(),
+ ['<Tab>'] = cmp.mapping.select_next_item(),
+ ['<C-k>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-j>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.close(),
+ ['<Return>'] = cmp.mapping.confirm({
+ behavior = cmp.ConfirmBehavior.Insert,
+ select = false,
+ })
+ },
+ sources = {
+ { name = 'nvim_lsp' },
+ { name = 'vsnip' },
+ { name = 'path' },
+ { name = 'buffer' },
+ },
+})
+
diff --git a/neovim/.config/nvim/lua/plugins/fidget.lua b/neovim/.config/nvim/lua/plugins/fidget.lua
new file mode 100644
index 0000000..f6564d5
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/fidget.lua
@@ -0,0 +1,9 @@
+require("fidget").setup({
+ text = {
+ spinner = "dots", -- animation shown when tasks are ongoing
+ done = "✓", -- character shown when all tasks are complete
+ },
+ window = {
+ blend = 0, -- &winblend for the window
+ },
+})
diff --git a/neovim/.config/nvim/lua/plugins/github-theme.lua b/neovim/.config/nvim/lua/plugins/github-theme.lua
new file mode 100644
index 0000000..b000fbb
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/github-theme.lua
@@ -0,0 +1,4 @@
+require('github-theme').setup({
+ transparent = true,
+ theme_style = "dark_default",
+})
diff --git a/neovim/.config/nvim/lua/plugins/gitsigns.lua b/neovim/.config/nvim/lua/plugins/gitsigns.lua
new file mode 100644
index 0000000..61f6238
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/gitsigns.lua
@@ -0,0 +1,27 @@
+local map = vim.keymap.set
+
+require("gitsigns").setup({
+ signs = {
+ add = { text = "+" },
+ delete = { text = "-" },
+ change = { text = "~" },
+ changedelete = { text = "⋍" },
+ },
+ on_attach = function(buf)
+ local gs = package.loaded.gitsigns
+ local opts = { buffer = buf, expr = true, replace_keycodes = false }
+
+ -- Navigation
+ map("n", "]c", "&diff ? ']c' : '<CMD>Gitsigns next_hunk<CR>'", opts)
+ map("n", "[c", "&diff ? '[c' : '<CMD>Gitsigns prev_hunk<CR>'", opts)
+
+ -- Actions
+ map({ "n", "v" }, "<leader>hr", gs.reset_hunk, { buffer = buf })
+ map({ "n", "v" }, "<leader>hs", gs.stage_hunk)
+ map("n", "<leader>hS", gs.stage_buffer, { buffer = buf })
+ map("n", "<leader>hp", gs.preview_hunk, { buffer = buf })
+
+ -- Text object
+ map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", { buffer = buf })
+ end,
+})
diff --git a/neovim/.config/nvim/lua/plugins/lsp.lua b/neovim/.config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..db73c10
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,79 @@
+require("lspconfig")
+
+local sign = function(opts)
+ vim.fn.sign_define(opts.name, {
+ texthl = opts.name,
+ text = opts.text,
+ numhl = ''
+ })
+end
+
+sign({name = 'DiagnosticSignError', text = ''})
+sign({name = 'DiagnosticSignWarn', text = ''})
+sign({name = 'DiagnosticSignHint', text = ''})
+sign({name = 'DiagnosticSignInfo', text = ''})
+
+vim.diagnostic.config({
+ signs = true,
+ virtual_text = false,
+ update_in_insert = true,
+ underline = false,
+ severity_sort = true,
+ float = {
+ source = 'always',
+ header = '',
+ prefix = '',
+ },
+})
+
+require("keybinds")
+
+map("n", "<F2>", "<cmd>lua vim.lsp.buf.rename()<cr>")
+map("n", "<C-h>", "<cmd>lua vim.diagnostic.open_float()<cr>")
+
+--[[
+nnoremap <silent> <c-]> <cmd>lua vim.lsp.buf.definition()<CR>
+nnoremap <silent> K <cmd>lua vim.lsp.buf.hover()<CR>
+nnoremap <silent> gD <cmd>lua vim.lsp.buf.implementation()<CR>
+nnoremap <silent> <c-k> <cmd>lua vim.lsp.buf.signature_help()<CR>
+nnoremap <silent> 1gD <cmd>lua vim.lsp.buf.type_definition()<CR>
+nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>
+nnoremap <silent> g0 <cmd>lua vim.lsp.buf.document_symbol()<CR>
+nnoremap <silent> gW <cmd>lua vim.lsp.buf.workspace_symbol()<CR>
+nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>
+
+-- Jump to the definition
+bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
+
+-- Jump to declaration
+bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
+
+-- Lists all the implementations for the symbol under the cursor
+bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
+
+-- Jumps to the definition of the type symbol
+bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
+
+-- Lists all the references
+bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
+
+-- Displays a function's signature information
+bufmap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
+
+-- Renames all references to the symbol under the cursor
+bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
+
+-- Selects a code action available at the current cursor position
+bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
+bufmap('x', '<F4>', '<cmd>lua vim.lsp.buf.range_code_action()<cr>')
+
+-- Show diagnostics in a floating window
+bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
+
+-- Move to the previous diagnostic
+bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
+
+-- Move to the next diagnostic
+bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
+]]
+
diff --git a/neovim/.config/nvim/lua/plugins/lualine.lua b/neovim/.config/nvim/lua/plugins/lualine.lua
new file mode 100644
index 0000000..353e691
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/lualine.lua
@@ -0,0 +1,34 @@
+require("lualine").setup({
+ options = {
+ theme = "catppuccin",
+ component_separators = { left = "»", right = "«" },
+ section_separators = "",
+ icons_enabled = true,
+ globalstatus = true,
+ },
+ sections = {
+ lualine_a = {
+ { "mode", color = { gui = "bold" } },
+ },
+ lualine_b = {
+ { "branch" },
+ { "diff", colored = false },
+ },
+ lualine_c = {
+ { "filename", file_status = true },
+ { "diagnostics" },
+ },
+ lualine_x = {
+ { "filetype" },
+ { "fileformat", icons_enabled = false },
+ { "encoding" },
+ },
+ lualine_y = {
+ { "progress" },
+ },
+ lualine_z = {
+ { "location", color = { gui = "bold" } },
+ },
+ },
+ extensions = { "quickfix", "nvim-tree" },
+})
diff --git a/neovim/.config/nvim/lua/plugins/mason.lua b/neovim/.config/nvim/lua/plugins/mason.lua
new file mode 100644
index 0000000..3e97958
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/mason.lua
@@ -0,0 +1,10 @@
+require("mason").setup({
+ ui = {
+ icons = {
+ package_installed = "✓",
+ package_pending = "➜",
+ package_uninstalled = "✗"
+ }
+ }
+})
+require("mason-lspconfig").setup()
diff --git a/neovim/.config/nvim/lua/plugins/pairs.lua b/neovim/.config/nvim/lua/plugins/pairs.lua
new file mode 100644
index 0000000..ed0e692
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/pairs.lua
@@ -0,0 +1,2 @@
+require("nvim-autopairs").setup()
+require("cmp").event:on("confirm_done", require("nvim-autopairs.completion.cmp").on_confirm_done())
diff --git a/neovim/.config/nvim/lua/plugins/rust-tools.lua b/neovim/.config/nvim/lua/plugins/rust-tools.lua
new file mode 100644
index 0000000..c8442aa
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/rust-tools.lua
@@ -0,0 +1,24 @@
+require("rust-tools").setup({
+ tools = {
+ autoSetHints = true,
+ inlay_hints = {
+ auto = false,
+ show_parameter_hints = false,
+ parameter_hints_prefix = "",
+ other_hints_prefix = "",
+ },
+ },
+
+ -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
+ server = {
+ settings = {
+ -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
+ ["rust-analyzer"] = {
+ checkOnSave = {
+ command = "clippy"
+ },
+ }
+ }
+ },
+})
+
diff --git a/neovim/.config/nvim/lua/plugins/telescope.lua b/neovim/.config/nvim/lua/plugins/telescope.lua
new file mode 100644
index 0000000..01dcb2f
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/telescope.lua
@@ -0,0 +1,64 @@
+local actions = require("telescope.actions")
+local finders = require("telescope.builtin")
+
+local action_mt = require "telescope.actions.mt"
+local action_state = require "telescope.actions.state"
+-- global for later inspection
+custom_actions = action_mt.transform_mod({
+ print_entry = function()
+ print(vim.inspect(action_state.get_selected_entry()))
+ end,
+})
+
+require("telescope").setup({
+ defaults = {
+ prompt_prefix = " ",
+ initial_mode = "insert",
+ sorting_strategy = "ascending",
+ layout_config = {
+ prompt_position = "top",
+ },
+ mappings = {
+ i = {
+ ["<C-M>"] = custom_actions['print_entry'],
+ ["<ESC>"] = actions.close,
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<TAB>"] = actions.toggle_selection + actions.move_selection_next,
+ ["<C-s>"] = actions.send_selected_to_qflist,
+ ["<C-q>"] = actions.send_to_qflist,
+ },
+ },
+ },
+ extensions = {
+ fzf = {
+ fuzzy = true,
+ override_generic_sorter = true,
+ override_file_sorter = true,
+ case_mode = "smart_case",
+ },
+ },
+})
+
+local Telescope = setmetatable({}, {
+ __index = function(_, k)
+ if vim.bo.filetype == "NvimTree" then
+ vim.cmd.wincmd("l")
+ end
+ return finders[k]
+ end,
+})
+
+vim.keymap.set("n", "<C-space>", function()
+ local ok = pcall(Telescope.git_files, { show_untracked = true })
+ if not ok then
+ Telescope.find_files()
+ end
+end)
+
+-- Get :help at the speed of light
+vim.keymap.set("n", "<leader>H", Telescope.help_tags)
+-- Search for string
+vim.keymap.set("n", "<leaders>s", Telescope.live_grep)
+-- Fuzzy find changed files in git
+vim.keymap.set("n", "<leader>c", Telescope.git_status)
diff --git a/neovim/.config/nvim/lua/plugins/treesitter.lua b/neovim/.config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..e3d8fbb
--- /dev/null
+++ b/neovim/.config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,126 @@
+-- Treesitter folds
+-- vim.o.foldmethod = "expr"
+-- vim.o.foldexpr = "nvim_treesitter#foldexpr()"
+-- vim.o.foldlevelstart = 99
+
+require("nvim-treesitter.configs").setup({
+ -- nvim-treesitter/nvim-treesitter (self config)
+ auto_install = true,
+ ensure_installed = {
+ "c",
+ "lua",
+ "rust",
+ "go",
+ "javascript",
+ "typescript",
+ "tsx",
+ "markdown",
+ "markdown_inline",
+ "html",
+ "css",
+ "json",
+ "bash",
+ },
+ highlight = {
+ enable = true,
+ -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
+ -- Set this to `true` if you depend on "syntax" being enabled (like for indentation).
+ -- Using this option may slow down your editor, and you may see some duplicate highlights.
+ -- Instead of true it can also be a list of languages
+ additional_vim_regex_highlighting = false,
+ },
+ indent = {
+ enable = true,
+ },
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "gs",
+ -- NOTE: These are visual mode mappings
+ node_incremental = "gs",
+ node_decremental = "gS",
+ scope_incremental = "<leader>gc",
+ },
+ },
+ -- nvim-treesitter/nvim-treesitter-textobjects
+ textobjects = {
+ select = {
+ enable = true,
+ -- Automatically jump forward to textobj, similar to targets.vim
+ lookahead = true,
+ keymaps = {
+ -- You can use the capture groups defined in textobjects.scm
+ ["af"] = "@function.outer",
+ ["if"] = "@function.inner",
+ ["ac"] = "@class.outer",
+ ["ic"] = "@class.inner",
+ ["al"] = "@loop.outer",
+ ["il"] = "@loop.inner",
+ ["aa"] = "@parameter.outer",
+ ["ia"] = "@parameter.inner",
+ ["uc"] = "@comment.outer",
+
+ -- Or you can define your own textobjects like this
+ -- ["iF"] = {
+ -- python = "(function_definition) @function",
+ -- cpp = "(function_definition) @function",
+ -- c = "(function_definition) @function",
+ -- java = "(method_declaration) @function",
+ -- },
+ },
+ },
+ swap = {
+ enable = true,
+ swap_next = {
+ ["<leader>a"] = "@parameter.inner",
+ ["<leader>f"] = "@function.outer",
+ ["<leader>e"] = "@element",
+ },
+ swap_previous = {
+ ["<leader>A"] = "@parameter.inner",
+ ["<leader>F"] = "@function.outer",
+ ["<leader>E"] = "@element",
+ },
+ },
+ move = {
+ enable = true,
+ set_jumps = true, -- whether to set jumps in the jumplist
+ goto_next_start = {
+ ["]f"] = "@function.outer",
+ ["]]"] = "@class.outer",
+ },
+ goto_next_end = {
+ ["]F"] = "@function.outer",
+ ["]["] = "@class.outer",
+ },
+ goto_previous_start = {
+ ["[f"] = "@function.outer",
+ ["[["] = "@class.outer",
+ },
+ goto_previous_end = {
+ ["[F"] = "@function.outer",
+ ["[]"] = "@class.outer",
+ },
+ },
+ },
+ -- windwp/nvim-ts-autotag
+ autotag = {
+ enable = true,
+ },
+ -- nvim-treesitter/playground
+ 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
+ },
+ -- nvim-treesitter/nvim-treesitter-refactor
+ refactor = {
+ highlight_definitions = { enable = true },
+ -- highlight_current_scope = { enable = false },
+ },
+ context_commentstring = {
+ enable = true,
+ enable_autocmd = false,
+ },
+})
diff --git a/neovim/.config/nvim/lua/settings.lua b/neovim/.config/nvim/lua/settings.lua
new file mode 100644
index 0000000..e65dbff
--- /dev/null
+++ b/neovim/.config/nvim/lua/settings.lua
@@ -0,0 +1,53 @@
+local g = vim.g
+local o = vim.o
+
+-- Amount of lines to keep below and above the cursor
+o.scrolloff = 10
+
+-- I like it this way
+o.number = true
+o.cursorline = true
+o.relativenumber = true
+o.numberwidth = 4
+
+o.signcolumn = "yes:1"
+o.shortmess = o.shortmess .. "c"
+o.completeopt = "menuone,noselect,noinsert"
+
+o.hidden = true
+o.backup = false
+o.undofile = true
+o.swapfile = false
+o.writebackup = false
+o.encoding = "utf-8"
+o.guicursor = "a:ver25-blinkwait50-blinkon50-blinkoff50"
+
+o.ruler = true
+o.showcmd = true
+o.showmode = true
+o.laststatus = 2
+
+o.smarttab = true
+o.expandtab = true
+o.autoindent = true
+o.softtabstop = -1
+o.shiftwidth = 2
+o.tabstop = 2
+
+-- Search is case insensitive unless /C or searched capitalized
+o.hlsearch = true
+o.incsearch = true
+o.smartcase = true
+o.ignorecase = true
+
+-- Invisible characters
+o.list = true
+o.listchars = "trail:·,nbsp:×,tab:->"
+
+-- Clipboard works with os
+o.clipboard = "unnamedplus"
+
+-- Map leader to space
+g.mapleader = " "
+g.maplocalleader = " "
+