From 242885a51fa0ade94a3cd733228b837f8226bf7a Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Mon, 7 Aug 2023 15:52:13 +0200 Subject: [PATCH] feat: initial commit --- justfile | 2 + nvim/init.lua | 98 +++++++++++++++++++++ nvim/lua/plugins/alpha.lua | 28 ++++++ nvim/lua/plugins/autopairs.lua | 5 ++ nvim/lua/plugins/bufferline.lua | 8 ++ nvim/lua/plugins/cmp.lua | 53 ++++++++++++ nvim/lua/plugins/comment.lua | 22 +++++ nvim/lua/plugins/git.lua | 31 +++++++ nvim/lua/plugins/gruvbox.lua | 9 ++ nvim/lua/plugins/indent-blankline.lua | 10 +++ nvim/lua/plugins/init.lua | 7 ++ nvim/lua/plugins/lspconfig.lua | 110 ++++++++++++++++++++++++ nvim/lua/plugins/lualine.lua | 10 +++ nvim/lua/plugins/neo-tree.lua | 12 +++ nvim/lua/plugins/slime.lua | 7 ++ nvim/lua/plugins/telekasten.lua | 58 +++++++++++++ nvim/lua/plugins/telescope.lua | 59 +++++++++++++ nvim/lua/plugins/tmux-navigator.lua | 12 +++ nvim/lua/plugins/treesitter-context.lua | 7 ++ nvim/lua/plugins/treesitter.lua | 17 ++++ nvim/lua/plugins/trouble.lua | 13 +++ nvim/lua/plugins/which-key.lua | 11 +++ 22 files changed, 589 insertions(+) create mode 100644 justfile create mode 100644 nvim/init.lua create mode 100644 nvim/lua/plugins/alpha.lua create mode 100644 nvim/lua/plugins/autopairs.lua create mode 100644 nvim/lua/plugins/bufferline.lua create mode 100644 nvim/lua/plugins/cmp.lua create mode 100644 nvim/lua/plugins/comment.lua create mode 100644 nvim/lua/plugins/git.lua create mode 100644 nvim/lua/plugins/gruvbox.lua create mode 100644 nvim/lua/plugins/indent-blankline.lua create mode 100644 nvim/lua/plugins/init.lua create mode 100644 nvim/lua/plugins/lspconfig.lua create mode 100644 nvim/lua/plugins/lualine.lua create mode 100644 nvim/lua/plugins/neo-tree.lua create mode 100644 nvim/lua/plugins/slime.lua create mode 100644 nvim/lua/plugins/telekasten.lua create mode 100644 nvim/lua/plugins/telescope.lua create mode 100644 nvim/lua/plugins/tmux-navigator.lua create mode 100644 nvim/lua/plugins/treesitter-context.lua create mode 100644 nvim/lua/plugins/treesitter.lua create mode 100644 nvim/lua/plugins/trouble.lua create mode 100644 nvim/lua/plugins/which-key.lua diff --git a/justfile b/justfile new file mode 100644 index 0000000..2e9dc8a --- /dev/null +++ b/justfile @@ -0,0 +1,2 @@ +install: + stow --verbose --target="${HOME}/.config/nvim" nvim diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..e27f6bf --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,98 @@ +-- luacheck: globals vim + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +vim.g.mapleader = "," +vim.g.maplocaleader = "\\" + +require("lazy").setup('plugins') + +vim.opt.wrap = false +vim.opt.number = true +vim.opt.compatible = false +vim.opt.mouse = "a" -- mouse support +vim.opt.showcmd = true -- show incomplete cmds down the bottom +vim.opt.showmode = true -- show current mode +vim.opt.showmatch = true -- set show matching parenthesis +vim.opt.visualbell = true -- no sounds +vim.opt.autoread = true -- reload files changed outside of vim +vim.opt.backspace = [[indent,eol,start]] -- allow backspacing over everything in insert mode +vim.opt.ignorecase = true -- ignore case when searching +vim.opt.shiftround = true -- use multiple of shiftwidth when indenting with '<' and '>' +vim.opt.smartcase = true -- ignore case if searching pattern is all lowecase, case-sensitive otherwise +vim.opt.smarttab = true -- insert tabs on the start of a line according to shiftwidth, not tabstop +vim.opt.hlsearch = true -- highlight search terms +vim.opt.incsearch = true -- show search matches as you type +vim.opt.hidden = true +vim.opt.ruler = true +vim.opt.clipboard = "unnamed" -- system clipboard +vim.opt.colorcolumn = "80" + +-- vim.cmd("syntax on") +vim.cmd("filetype plugin on") + +if vim.fn.has("multi_byte") == 1 and vim.o.encoding == "utf-8" then + vim.opt.listchars = [[tab:▸ ,extends:❯,precedes:❮,nbsp:±,trail:…]] +else + vim.opt.listchars = [[tab:> ,extends:>,precedes:<,nbsp:.,trail:_]] +end + +vim.opt.splitbelow = true +vim.opt.splitright = true +vim.api.nvim_set_keymap('n', "", "r", {}) + +vim.api.nvim_set_keymap('n', "", "1gt", {}) +vim.api.nvim_set_keymap('n', "", "2gt", {}) +vim.api.nvim_set_keymap('n', "", "3gt", {}) +vim.api.nvim_set_keymap('n', "", "4gt", {}) +vim.api.nvim_set_keymap('n', "", "5gt", {}) +vim.api.nvim_set_keymap('n', "", "6gt", {}) +vim.api.nvim_set_keymap('n', "", "7gt", {}) +vim.api.nvim_set_keymap('n', "", "8gt", {}) +vim.api.nvim_set_keymap('n', "", ":tablast", {}) + +vim.api.nvim_set_keymap('n', "", ":nohl", { noremap = true }) + +-- todo: try to do it with `vim.api.nvim_set_hl` +vim.cmd("hi CursorLine cterm=NONE,underline ctermbg=NONE") -- highlight line when in insert mode + +vim.opt.timeoutlen = 1000 +vim.opt.ttimeoutlen = 0 + +vim.cmd("autocmd InsertEnter * :set cursorline") +vim.cmd("autocmd InsertLeave * :set nocursorline") + +-- indentation +vim.cmd("filetype indent on") +vim.opt.softtabstop = 4 +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.autoindent = true +vim.opt.copyindent = true + +-- folds +vim.opt.foldmethod = "indent" +vim.opt.foldnestmax = 3 +vim.opt.foldenable = false + +vim.opt.termguicolors = true + +-- vim.g.markdown_syntax_conceal = 0 + +vim.opt.updatetime = 100 -- to make gigutter more responsive + +if vim.g.neovide then + vim.o.guifont = "Hack Nerd Font:h10" +end diff --git a/nvim/lua/plugins/alpha.lua b/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..abb0430 --- /dev/null +++ b/nvim/lua/plugins/alpha.lua @@ -0,0 +1,28 @@ +return { + 'goolord/alpha-nvim', + event = "VimEnter", + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + local alpha = require('alpha') + local dashboard = require('alpha.themes.dashboard') + dashboard.section.header.val = { + [[┌┐┌┌─┐┌─┐┬ ┬┬┌┬┐]], + [[│││├┤ │ │└┐┌┘││││]], + [[┘└┘└─┘└─┘ └┘ ┴┴ ┴]], + } + dashboard.section.buttons.val = { + dashboard.button("e", " New file", ":ene"), + dashboard.button(",ff", "󰈞 Find file", "Telescope find_files"), + dashboard.button(",fg", "󰈬 Find word", "Telescope live_grep"), + dashboard.button(",zn", "󱞁 Write note", "Telekasten new_note"), + dashboard.button(",zf", "󱙓 Find note", "Telekasten find_notes"), + dashboard.button("q", "󰅚 Quit", ":qa"), + } + alpha.setup(dashboard.config) + end +} + +-- 󰊄 Recently opened files SPC f h +--  Frecency/MRU SPC f r +--  Jump to bookmarks SPC f m +--  Open last session SPC s l diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua new file mode 100644 index 0000000..2c166be --- /dev/null +++ b/nvim/lua/plugins/autopairs.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-autopairs', + event = 'InsertEnter', + config = {}, +} diff --git a/nvim/lua/plugins/bufferline.lua b/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..2e6d6af --- /dev/null +++ b/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,8 @@ +return { + "akinsho/bufferline.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + vim.opt.termguicolors = true + require("bufferline").setup {} + end +} diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua new file mode 100644 index 0000000..a0e9675 --- /dev/null +++ b/nvim/lua/plugins/cmp.lua @@ -0,0 +1,53 @@ +return { + "hrsh7th/nvim-cmp", -- Autocompletion plugin + dependencies = { + "hrsh7th/cmp-nvim-lsp", -- LSP source for nvim-cmp + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp + "L3MON4D3/LuaSnip", -- Snippets plugin + }, + config = function() + require('cmp').setup { + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) + end, + }, + mapping = require('cmp').mapping.preset.insert({ + [''] = require('cmp').mapping.scroll_docs(-4), -- Up + [''] = require('cmp').mapping.scroll_docs(4), -- Down + -- C-b (back) C-f (forward) for snippet placeholder navigation. + [''] = require('cmp').mapping.complete(), + [''] = require('cmp').mapping.confirm { + behavior = require('cmp').ConfirmBehavior.Replace, + select = true, + }, + [''] = require('cmp').mapping(function(fallback) + if require('cmp').visible() then + require('cmp').select_next_item() + elseif require('luasnip').expand_or_jumpable() then + require('luasnip').expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + [''] = require('cmp').mapping(function(fallback) + if require('cmp').visible() then + require('cmp').select_prev_item() + elseif require('luasnip').jumpable(-1) then + require('luasnip').jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }), + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'buffer' }, + { name = 'path' }, + }, + } + end, +} diff --git a/nvim/lua/plugins/comment.lua b/nvim/lua/plugins/comment.lua new file mode 100644 index 0000000..80aa12d --- /dev/null +++ b/nvim/lua/plugins/comment.lua @@ -0,0 +1,22 @@ +return { + "numToStr/Comment.nvim", + config = { + toggler = { + line = 'c', + block = 'b' + }, + opleader = { + line = 'c', + block = 'b', + }, + extra = { + above = 'cO', + below = 'co', + eol = 'cA', + }, + mappings = { + basic = true, + extra = false, + }, + }, +} diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..a5dcc85 --- /dev/null +++ b/nvim/lua/plugins/git.lua @@ -0,0 +1,31 @@ +return { + 'dinhhuy258/git.nvim', + config = { + default_mappings = true, -- NOTE: `quit_blame` and `blame_commit` are still merged to the keymaps even if `default_mappings = false` + + keymaps = { + -- Open blame window + blame = "gb", + -- Close blame window + quit_blame = "q", + -- Open blame commit + blame_commit = "", + -- Open file/folder in git repository + browse = "go", + -- Open pull request of the current branch + open_pull_request = "gp", + -- Create a pull request with the target branch is set in the `target_branch` option + create_pull_request = "gn", + -- Opens a new diff that compares against the current index + diff = "gd", + -- Close git diff + diff_close = "gD", + -- Revert to the specific commit + revert = "gr", + -- Revert the current file to the specific commit + revert_file = "gR", + }, + -- Default target branch when create a pull request + target_branch = "main", + } +} diff --git a/nvim/lua/plugins/gruvbox.lua b/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 0000000..762c6f9 --- /dev/null +++ b/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,9 @@ +return { + "ellisonleao/gruvbox.nvim", + lazy = false, + priority = 1000, + config = function() + vim.o.background = "dark" + vim.cmd([[colorscheme gruvbox]]) + end +} diff --git a/nvim/lua/plugins/indent-blankline.lua b/nvim/lua/plugins/indent-blankline.lua new file mode 100644 index 0000000..f78a1fb --- /dev/null +++ b/nvim/lua/plugins/indent-blankline.lua @@ -0,0 +1,10 @@ +return { + "lukas-reineke/indent-blankline.nvim", + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + config = { + -- show_current_context = true, + -- show_current_context_start = true, + show_current_context = false, + show_current_context_start = false, + }, +} diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..299d2d7 --- /dev/null +++ b/nvim/lua/plugins/init.lua @@ -0,0 +1,7 @@ +return { + "psliwka/vim-smoothie", + "tpope/vim-unimpaired", + "tpope/vim-surround", + "tpope/vim-fugitive", + "mzlogin/vim-markdown-toc", +} diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..c7c1d40 --- /dev/null +++ b/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,110 @@ +return { + "neovim/nvim-lspconfig", + lazy = false, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + + lspconfig.pyright.setup { capabilities = capabilities } + lspconfig.ruff_lsp.setup { capabilities = capabilities } + + lspconfig.nixd.setup { capabilities = capabilities } + lspconfig.jsonls.setup { capabilities = capabilities } + lspconfig.beancount.setup { capabilities = capabilities } + lspconfig.ltex.setup { capabilities = capabilities } + + lspconfig.terraformls.setup { capabilities = capabilities } + lspconfig.tflint.setup { capabilities = capabilities } + + lspconfig.docker_compose_language_service.setup { + root_dir = lspconfig.util.root_pattern("docker-compose.yaml", "docker-compose.yml"), + filetypes = { "yaml", "yaml.docker-compose" }, + capabilities = capabilities, + } + lspconfig.dockerls.setup { capabilities = capabilities } + + -- lspconfig.sqlls.setup {capabilities = capabilities} + + lspconfig.lua_ls.setup { + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { "vim" }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, + capabilities = capabilities + } + + lspconfig.efm.setup { + init_options = { documentFormatting = true }, + filetypes = { "python", "sh" }, + settings = { + rootMarkers = { ".git/", "pyproject.toml" }, + languages = { + python = { { formatCommand = "black -", formatStdin = true } }, + sql = { { + formatCommand = "sqlfluff fix --dialect bigquery -", + formatStdin = true + } }, + sh = { { + formatCommand = "shfmt -i 4 -bn -sr -p -ci", + formatStdin = true, + lintCommand = "shellcheck -f gcc -x", + lintSource = "shellcheck", + lintFormats = { + "%f:%l:%c: %trror: %m", + "%f:%l:%c: %tarning: %m", + "%f:%l:%c: %tote: %m", + } + } }, + }, + }, + capabilities = capabilities + } + + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" + end + }) + end, + + keys = { + { 'gD', vim.lsp.buf.declaration }, + { 'gd', vim.lsp.buf.definition }, + { 'K', vim.lsp.buf.hover }, + { 'gi', vim.lsp.buf.implementation }, + { '', vim.lsp.buf.signature_help }, + { 'wa', vim.lsp.buf.add_workspace_folder }, + { 'wr', vim.lsp.buf.remove_workspace_folder }, + { 'D', vim.lsp.buf.type_definition }, + { 'rn', vim.lsp.buf.rename }, + { 'gr', vim.lsp.buf.references }, + { 'ca', vim.lsp.buf.code_action, { 'n', 'v' } }, + { 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end }, + { 'f', function() + vim.lsp.buf.format { async = true } + end }, + }, +} diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..848b1aa --- /dev/null +++ b/nvim/lua/plugins/lualine.lua @@ -0,0 +1,10 @@ +return { + 'nvim-lualine/lualine.nvim', + dependenceies = { 'nvim-tree/nvim-web-devicons' }, + config = { + icons_enabled = true, + theme = 'gruvbox_dark', + component_separators = '|', + section_separators = '', + } +} diff --git a/nvim/lua/plugins/neo-tree.lua b/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..61d5e64 --- /dev/null +++ b/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,12 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + cmd = "Neotree", + keys = { { "t", "Neotree toggle" } }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + "s1n7ax/nvim-window-picker", + } +} diff --git a/nvim/lua/plugins/slime.lua b/nvim/lua/plugins/slime.lua new file mode 100644 index 0000000..1b5d8c9 --- /dev/null +++ b/nvim/lua/plugins/slime.lua @@ -0,0 +1,7 @@ +return { + "jpalardy/vim-slime", + config = function() + vim.g["slime_target"] = "tmux" + vim.g["slime_python_ipython"] = 1 + end +} diff --git a/nvim/lua/plugins/telekasten.lua b/nvim/lua/plugins/telekasten.lua new file mode 100644 index 0000000..67e7c53 --- /dev/null +++ b/nvim/lua/plugins/telekasten.lua @@ -0,0 +1,58 @@ +return { + 'renerocksai/telekasten.nvim', + cmd = "Telekasten", + dependencies = { + 'nvim-telescope/telescope.nvim', + 'renerocksai/calendar-vim', + { + 'nvim-telescope/telescope-media-files.nvim', + dependencies = { + 'nvim-lua/popup.nvim', + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'nvim-telescope/telescope-media-files.nvim', + }, + }, + }, + config = function() + require('telekasten').setup { + home = vim.fn.expand("~/notes"), + daily = vim.fn.expand("~/notes/daily"), + weeklies = vim.fn.expand("~/notes/weeklies"), + templates = vim.fn.expand("~/notes/templates"), + auto_set_filetype = false, + install_syntax = true, + media_previewer = "telescope-media-files", + } + vim.cmd("hi tklink ctermfg=72 guifg=#689d6a cterm=bold,underline gui=bold,underline") + vim.cmd("hi tkBrackets ctermfg=gray guifg=gray") + end, + + keys = { + { "z", 'Telekasten panel' }, + { "zf", 'Telekasten find_notes' }, + { "zd", 'Telekasten find_daily_notes' }, + { "zg", 'Telekasten search_notes' }, + { "zz", 'Telekasten follow_link' }, + { "zT", 'Telekasten goto_today' }, + { "zW", 'Telekasten goto_thisweek' }, + { "zw", 'Telekasten find_weekly_notes' }, + { "zn", 'Telekasten new_note' }, + { "zN", 'Telekasten new_templated_note' }, + { "zy", 'Telekasten yank_notelink' }, + { "zc", 'Telekasten show_calendar' }, + { "zi", 'Telekasten paste_img_and_link' }, + { "zt", 'Telekasten toggle_todo' }, + { "zb", 'Telekasten show_backlinks' }, + { "zF", 'Telekasten find_friends' }, + { "zp", 'Telekasten preview_img' }, + { "zm", 'Telekasten browse_media' }, + { "#", 'Telekasten show_tags' }, + { "zI", function() require('telekasten').insert_img_link({ i = true }) end }, + { "zt", function() require('telekasten').toggle_todo({ v = true }) end, "v" }, + { "zt", function() require('telekasten').toggle_todo({ i = true }) end, "i" }, + { "#", function() require('telekasten').show_tags({ i = true }) end, "i" }, + -- { "[[", function() require('telekasten').insert_link({ i = true }) end, "i" }, + { "zC", "CalendarT" }, + }, +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..f62dfdf --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,59 @@ +return { + 'nvim-telescope/telescope.nvim', + cmd = "Telescope", + dependencies = { + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make' + }, + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-symbols.nvim', + "nvim-telescope/telescope-bibtex.nvim", + { + 'nvim-telescope/telescope-media-files.nvim', + dependencies = { + 'nvim-lua/popup.nvim', + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope.nvim', + 'nvim-telescope/telescope-media-files.nvim', + }, + }, + }, + config = function() + local telescope = require("telescope") + telescope.setup { + extensions = { + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, + -- media_files = { + -- -- filetypes whitelist + -- -- defaults to {"png", "jpg", "mp4", "webm", "pdf"} + -- filetypes = { "png", "webp", "jpg", "jpeg" }, + -- -- find command (defaults to `fd`) + -- find_cmd = "rg" + -- }, + bibtex = { + global_files = { vim.fn.expand("~/notes/refs") }, + } + } + } + telescope.load_extension("fzf") + telescope.load_extension("media_files") + telescope.load_extension("bibtex") + end, + keys = { + { 'ff', 'Telescope find_files' }, + { 'fg', 'Telescope live_grep' }, + { 'fb', 'Telescope buffers' }, + { 'fh', 'Telescope help_tags' }, + { 'fs', function() + require('telescope_builtin').symbols({ sources = 'emoji', 'gitmoji', 'nerd' }) + end }, + -- { 'fb', "Telescope bibtex"} + } +} diff --git a/nvim/lua/plugins/tmux-navigator.lua b/nvim/lua/plugins/tmux-navigator.lua new file mode 100644 index 0000000..698ed94 --- /dev/null +++ b/nvim/lua/plugins/tmux-navigator.lua @@ -0,0 +1,12 @@ +return { + "christoomey/vim-tmux-navigator", + config = function() + vim.g["tmux_navigator_no_mappings"] = 1 + end, + keys = { + { "", "TmuxNavigateLeft" }, + { "", "TmuxNavigateDown" }, + { "", "TmuxNavigateUp" }, + { "", "TmuxNavigateRight" }, + } +} diff --git a/nvim/lua/plugins/treesitter-context.lua b/nvim/lua/plugins/treesitter-context.lua new file mode 100644 index 0000000..709a921 --- /dev/null +++ b/nvim/lua/plugins/treesitter-context.lua @@ -0,0 +1,7 @@ +return { + "nvim-treesitter/nvim-treesitter-context", + dependencies = { 'nvim-treesitter/nvim-treesitter' }, + config = { + enable = true, + }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..cd96c72 --- /dev/null +++ b/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,17 @@ +return { + "nvim-treesitter/nvim-treesitter", + dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" }, + build = ":TSUpdate", + config = function() + require('nvim-treesitter.configs').setup { + ensure_installed = "all", + sync_install = true, + ignore_install = {}, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + } + end +} diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..b101472 --- /dev/null +++ b/nvim/lua/plugins/trouble.lua @@ -0,0 +1,13 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + cmd = { "TroubleToggle", "Trouble" }, + keys = { + { 'xx', 'TroubleToggle' }, + { 'xw', 'TroubleToggle workspace_diagnostics' }, + { 'xd', 'TroubleToggle document_diagnostics' }, + { 'xq', 'TroubleToggle quickfix' }, + { 'xl', 'TroubleToggle loclist' }, + { 'gR', 'TroubleToggle lsp_references' }, + } +} diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..0e77cd3 --- /dev/null +++ b/nvim/lua/plugins/which-key.lua @@ -0,0 +1,11 @@ +return { + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 500 + end, + config = function() + require("which-key").setup() + end +}