diff --git a/configs/nvim/after/plugin/auto-pair.lua b/configs/nvim/after/plugin/auto-pair.lua index 1e64d6b..32c46b6 100644 --- a/configs/nvim/after/plugin/auto-pair.lua +++ b/configs/nvim/after/plugin/auto-pair.lua @@ -1,28 +1,30 @@ --- -- -- Setup nvim-cmp. --- local status_ok, npairs = pcall(require, "nvim-autopairs") --- if not status_ok then --- return +-- -- import nvim-autopairs safely +-- local autopairs_setup, autopairs = pcall(require, "nvim-autopairs") +-- if not autopairs_setup then +-- return -- end -- --- npairs.setup({ --- check_ts = true, -- treesitter integration --- disable_filetype = { "TelescopePrompt" }, --- ts_config = { --- lua = { "string", "source" }, --- javascript = { "string", "template_string" }, --- java = false, --- }, --- --- fast_wrap = { --- map = "", --- chars = { "{", "[", "(", '"', "'" }, --- pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), --- offset = 0, -- Offset from pattern match --- end_key = "$", --- keys = "qwertyuiopzxcvbnmasdfghjkl", --- check_comma = true, --- highlight = "PmenuSel", --- highlight_grey = "LineNr", --- }, +-- -- configure autopairs +-- autopairs.setup({ +-- check_ts = true, -- enable treesitter +-- ts_config = { +-- lua = { "string" }, -- don't add pairs in lua string treesitter nodes +-- javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes +-- java = false, -- don't check treesitter on java +-- }, -- }) -- +-- -- import nvim-autopairs completion functionality safely +-- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") +-- if not cmp_autopairs_setup then +-- return +-- end +-- +-- -- import nvim-cmp plugin safely (completions plugin) +-- local cmp_setup, cmp = pcall(require, "cmp") +-- if not cmp_setup then +-- return +-- end +-- +-- -- make autopairs and completion work together +-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/configs/nvim/after/plugin/harpoon.lua b/configs/nvim/after/plugin/harpoon.lua index a4e8170..7ab7c47 100644 --- a/configs/nvim/after/plugin/harpoon.lua +++ b/configs/nvim/after/plugin/harpoon.lua @@ -6,7 +6,7 @@ vim.keymap.set("n", "a", mark.add_file) vim.keymap.set("n", "", ui.toggle_quick_menu) -vim.keymap.set("n", "", function() ui.nav_file(1) end) +vim.keymap.set("n", "", function() ui.nav_file(1) end) vim.keymap.set("n", "", function() ui.nav_file(2) end) vim.keymap.set("n", "", function() ui.nav_file(3) end) vim.keymap.set("n", "", function() ui.nav_file(4) end) diff --git a/configs/nvim/after/plugin/lsp.lua b/configs/nvim/after/plugin/lsp.lua index 81a413e..9bfaeac 100644 --- a/configs/nvim/after/plugin/lsp.lua +++ b/configs/nvim/after/plugin/lsp.lua @@ -28,7 +28,7 @@ local cmp_select = { behavior = cmp.SelectBehavior.Select } local cmp_mappings = lsp.defaults.cmp_mappings({ [''] = cmp.mapping.select_prev_item(cmp_select), [''] = cmp.mapping.select_next_item(cmp_select), - [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.complete(), }) @@ -73,6 +73,15 @@ lsp.on_attach(function(client, bufnr) vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts) end) +-- local cmp_autopairs_setup, cmp_autopairs = pcall(require, "nvim-autopairs.completion.cmp") +-- if not cmp_autopairs_setup then +-- return +-- end +-- +-- cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) +require("luasnip.loaders.from_vscode").lazy_load() + + lsp.setup() vim.diagnostic.config({ diff --git a/configs/nvim/after/plugin/tmux.lua b/configs/nvim/after/plugin/tmux.lua new file mode 100644 index 0000000..ba46abf --- /dev/null +++ b/configs/nvim/after/plugin/tmux.lua @@ -0,0 +1,3 @@ +require'nvim-tmux-navigation'.setup { + disable_when_zoomed = true -- defaults to false +} diff --git a/configs/nvim/after/plugin/tree.lua b/configs/nvim/after/plugin/tree.lua index 8bfbe61..7eac352 100644 --- a/configs/nvim/after/plugin/tree.lua +++ b/configs/nvim/after/plugin/tree.lua @@ -1,21 +1,20 @@ -require("nvim-tree").setup({ - sort_by = "case_sensitive", - view = { - adaptive_size = true, - prefer_startup_root = true, - update_focused_file = { - { update_root = true }, - }, - mappings = { - list = { - { key = "u", action = "dir_up" }, - }, - }, - }, - renderer = { - group_empty = true, - }, - filters = { - dotfiles = true, - }, -}) +-- require("nvim-tree").setup({ +-- sort_by = "case_sensitive", +-- -- view = { +-- -- adaptive_size = true, +-- -- prefer_startup_root = true, +-- -- update_focused_file = { +-- -- { update_root = true }, +-- -- }, +-- -- mappings = { +-- -- list = { +-- -- { key = "u", action = "dir_up" }, +-- -- }, +-- -- }, +-- renderer = { +-- group_empty = true, +-- }, +-- filters = { +-- dotfiles = true, +-- }, +-- }) diff --git a/configs/nvim/after/plugin/treesitter.lua b/configs/nvim/after/plugin/treesitter.lua index fbecef1..f160c22 100644 --- a/configs/nvim/after/plugin/treesitter.lua +++ b/configs/nvim/after/plugin/treesitter.lua @@ -1,25 +1,38 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" - ensure_installed = { "help", "python", "javascript", "c", "lua", "rust", "bash" }, +require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" + ensure_installed = { + "help", + "python", + "javascript", + "c", + "lua", + "rust", + "bash", + "gitignore", + "vim", + "markdown", + "html", + "css", + }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = true, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - highlight = { - -- `false` will disable the whole extension - 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, - }, + highlight = { + -- `false` will disable the whole extension + 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, + }, - autotag = { - enable = true, - }, + autotag = { + enable = true, + }, } diff --git a/configs/nvim/lua/jabuxas/packer.lua b/configs/nvim/lua/jabuxas/packer.lua index 9ef70b9..bf29f06 100644 --- a/configs/nvim/lua/jabuxas/packer.lua +++ b/configs/nvim/lua/jabuxas/packer.lua @@ -80,7 +80,6 @@ return require('packer').startup(function(use) use 'xiyaowong/nvim-transparent' -- use { -- "windwp/nvim-autopairs", - -- config = function() require("nvim-autopairs").setup ({}) end -- } use({ 'nyoom-engineering/oxocarbon.nvim', @@ -124,11 +123,18 @@ return require('packer').startup(function(use) end }) + use { "alexghergh/nvim-tmux-navigation" } + use 'windwp/nvim-ts-autotag' use 'norcalli/nvim-colorizer.lua' use 'ThePrimeagen/vim-be-good' + use 'declancm/maximize.nvim' + + use({"L3MON4D3/LuaSnip", tag = "v.*"}) + use "rafamadriz/friendly-snippets" + if packer_bootstrap then require('packer').sync() end diff --git a/configs/nvim/lua/jabuxas/remap.lua b/configs/nvim/lua/jabuxas/remap.lua index 7abdbfb..267852e 100644 --- a/configs/nvim/lua/jabuxas/remap.lua +++ b/configs/nvim/lua/jabuxas/remap.lua @@ -1,38 +1,53 @@ -vim.keymap.set("n", "pv", vim.cmd.Ex) -vim.keymap.set("i", "jk", "") +local keymap = vim.keymap +local nvim_tmux_nav = require('nvim-tmux-navigation') + + +keymap.set("n", "pv", vim.cmd.Ex) +keymap.set("i", "jk", "") vim.g.mapleader = " " -vim.keymap.set("n", "pv", vim.cmd.Ex) -vim.keymap.set("n", "e", vim.cmd.NvimTreeToggle) +keymap.set("n", "pv", vim.cmd.Ex) +-- keymap.set("n", "e", vim.cmd.NreeToggle) -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '<-2gv=gv") +keymap.set("v", "J", ":m '>+1gv=gv") +keymap.set("v", "K", ":m '<-2gv=gv") -vim.keymap.set("n", "J", "mzJ`z") -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "n", "nzzzv") -vim.keymap.set("n", "N", "Nzzzv") +keymap.set("n", "J", "mzJ`z") +keymap.set("n", "", "zz") +keymap.set("n", "", "zz") +keymap.set("n", "n", "nzzzv") +keymap.set("n", "N", "Nzzzv") -vim.keymap.set("x", "p", [["_dP]]) -vim.keymap.set({ "n", "v" }, "y", [["+y]]) -vim.keymap.set("n", "Y", [["+Y]]) -vim.keymap.set({ "n", "v" }, "d", [["_d]]) -vim.keymap.set("i", "", "") +keymap.set("x", "p", [["_dP]]) +keymap.set({ "n", "v" }, "y", [["+y]]) +keymap.set("n", "Y", [["+Y]]) +keymap.set({ "n", "v" }, "d", [["_d]]) +keymap.set("i", "", "") -vim.keymap.set("n", "Q", "") -vim.keymap.set("n", "", "silent !tmux neww tmux-sessionizer") -vim.keymap.set("n", "f", vim.lsp.buf.format) +keymap.set("n", "Q", "") +keymap.set("n", "", "silent !tmux neww tmux-sessionizer") +keymap.set("n", "f", vim.lsp.buf.format) -vim.keymap.set("n", "", "cnextzz") -vim.keymap.set("n", "", "cprevzz") -vim.keymap.set("n", "k", "lnextzz") -vim.keymap.set("n", "j", "lprevzz") +keymap.set("n", "", "cnextzz") +keymap.set("n", "", "cprevzz") +keymap.set("n", "k", "lnextzz") +keymap.set("n", "j", "lprevzz") -vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) -vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) +keymap.set("n", "r", [[:%s/\<\>//gI]]) +keymap.set("n", "x", "!chmod +x %", { silent = true }) -vim.keymap.set("t", "", [[]]) +keymap.set("t", "", [[]]) + +keymap.set("n", "sv", "v") +keymap.set("n", "sh", "s") +keymap.set("n", "se", "=") +keymap.set("n", "sx", ":close") + +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateLeft) +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateDown) +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateUp) +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateRight) +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateLastActive) +keymap.set('n', "", nvim_tmux_nav.NvimTmuxNavigateNext) +keymap.set('n', 'sm', "lua require('maximize').toggle()") -vim.keymap.set("n", "", "ysst") -vim.keymap.set("v", "", "gSt") diff --git a/configs/nvim/lua/jabuxas/set.lua b/configs/nvim/lua/jabuxas/set.lua index 1a5eab2..3e954ee 100644 --- a/configs/nvim/lua/jabuxas/set.lua +++ b/configs/nvim/lua/jabuxas/set.lua @@ -4,7 +4,7 @@ vim.opt.mouse = 'a' vim.opt.nu = true vim.opt.relativenumber = true -vim.opt.clipboard:append { 'unnamedplus' } +vim.opt.clipboard:append {'unnamedplus'} vim.opt.tabstop = 4 vim.opt.softtabstop = 4 vim.opt.shiftwidth = 4 @@ -22,7 +22,6 @@ vim.opt.undofile = true vim.opt.hlsearch = false vim.opt.incsearch = true -vim.opt.termguicolors = true vim.opt.scrolloff = 8 vim.opt.signcolumn = "yes" @@ -38,6 +37,10 @@ vim.g.mapleader = " " -- vim.g.loaded_netrwPlugin = 1 -- Case insensitive searching UNLESS /C or capital in search -vim.o.ignorecase = true -vim.o.completeopt = 'menuone,noselect' -vim.o.smartcase = true +vim.opt.ignorecase = true +vim.opt.completeopt = 'menuone,noselect' +vim.opt.smartcase = true + +vim.opt.splitright = true +vim.opt.splitbelow = true +vim.opt.termguicolors = true