diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 8f979d3..363ce76 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,5 +1,6 @@ set-option -g default-terminal "screen-256color" set-option -ga terminal-overrides ",xterm-256color:Tc" +set -g default-terminal "tmux-256color" set-option -g focus-events on set-option -sg escape-time 10 @@ -30,7 +31,13 @@ bind -Tcopy-mode WheelDownPane send -N1 -X scroll-down set -g mode-keys vi # Enable mouse mode (tmux 2.1 and above) -set -g mouse off +bind-key M \ + set-option -g mouse on \;\ + display-message 'Mouse: ON' +# Toggle mouse off +bind-key m \ + set-option -g mouse off \;\ + display-message 'Mouse: OFF' bind h select-pane -L bind j select-pane -D diff --git a/configs/.zshrc b/configs/.zshrc index edc43f0..25887c9 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -84,6 +84,11 @@ if [ "$XDG_SESSION_TYPE" = "wayland" ]; then export MOZ_ENABLE_WAYLAND=1 fi +# If podman is installed load the autocompletion +if type podman &> /dev/null; then + source <(podman completion zsh) +fi + # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 504d8d3..a4c8a5c 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -17,6 +17,7 @@ require("configs.telescope") require("configs.tree") require("configs.treesitter") require("configs.autocomplete") +require("configs.neotest") require("configs.snippets") require("overlays") diff --git a/configs/nvim/lua/configs/autocomplete.lua b/configs/nvim/lua/configs/autocomplete.lua index 6e0f0df..ef24800 100644 --- a/configs/nvim/lua/configs/autocomplete.lua +++ b/configs/nvim/lua/configs/autocomplete.lua @@ -3,7 +3,7 @@ local luasnip = require("luasnip") local lspkind = require("lspkind") local cmp = require("cmp") local cmp_autopairs = require("nvim-autopairs.completion.cmp") -local tabnine = require("cmp_tabnine.config") +-- local tabnine = require("cmp_tabnine.config") local source_mapping = { buffer = "[Buffer]", @@ -13,18 +13,18 @@ local source_mapping = { path = "[Path]", } -tabnine:setup({ - max_lines = 1000, - max_num_results = 20, - sort = true, - run_on_every_keystroke = true, - snippet_placeholder = "..", - ignored_file_types = { -- default is not to ignore - -- uncomment to ignore in lua: - -- lua = true - }, - show_prediction_strength = false, -}) +-- tabnine:setup({ +-- max_lines = 1000, +-- max_num_results = 20, +-- sort = true, +-- run_on_every_keystroke = true, +-- snippet_placeholder = "..", +-- ignored_file_types = { -- default is not to ignore +-- -- uncomment to ignore in lua: +-- -- lua = true +-- }, +-- show_prediction_strength = false, +-- }) cmp.setup({ window = { @@ -79,7 +79,7 @@ cmp.setup({ sources = { { name = "nvim_lua" }, { name = "nvim_lsp" }, - { name = "cmp_tabnine", max_item_count = 3 }, + -- { name = "cmp_tabnine", max_item_count = 3 }, { name = "luasnip" }, { name = "path" }, { name = "buffer", max_item_count = 3 }, diff --git a/configs/nvim/lua/configs/lsp.lua b/configs/nvim/lua/configs/lsp.lua index c0625cf..9dd9353 100644 --- a/configs/nvim/lua/configs/lsp.lua +++ b/configs/nvim/lua/configs/lsp.lua @@ -6,7 +6,7 @@ require("null-ls").setup({ sources = { require("null-ls").builtins.formatting.stylua, require("null-ls").builtins.diagnostics.eslint, - require("null-ls").builtins.completion.spell, + -- require("null-ls").builtins.completion.spell, }, }) @@ -134,20 +134,45 @@ lsp.intelephense.setup({ capabilities = capabilities, on_attach = on_attach, }) + lsp.cssls.setup({ capabilities = capabilities, on_attach = on_attach, }) + lsp.zls.setup({ capabilities = capabilities, on_attach = on_attach, }) + lsp.bashls.setup({ capabilities = capabilities, filetypes = { "sh", "bash" }, on_attach = on_attach, }) +lsp.rust_analyzer.setup({ + on_attach = on_attach, + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + }, + }, +}) + -- lsp.remark_ls.setup { -- filetypes = { "markdown" }, -- on_attach = on_attach diff --git a/configs/nvim/lua/configs/neotest.lua b/configs/nvim/lua/configs/neotest.lua new file mode 100644 index 0000000..bf26089 --- /dev/null +++ b/configs/nvim/lua/configs/neotest.lua @@ -0,0 +1,5 @@ +require("neotest").setup({ + adapters = { + require("neotest-vitest")({}), + }, +}) diff --git a/configs/nvim/lua/configs/snippets.lua b/configs/nvim/lua/configs/snippets.lua index 77a1feb..aa78673 100644 --- a/configs/nvim/lua/configs/snippets.lua +++ b/configs/nvim/lua/configs/snippets.lua @@ -43,23 +43,33 @@ ls.add_snippets("all", { ls.add_snippets("svelte", { s("slt", { - t('"), + t({ "", "" }), }), s("sc", { - t('"), + t({ "", "" }), }), }) ls.add_snippets("typescript", { s("sget", { - t("export async function get({"), + t('export const GET: import("./$types").RequestHandler = async function get({'), i(1, "params"), t("}) {"), i(2), t("}"), }), + s("spost", { + t('export const POST: import("./$types").RequestHandler = async function get({'), + i(1, "params"), + t("}) {"), + i(2), + t("}"), + }), + s("ssess", { + t({ "const {userId} = locals.session.data", "if(!userId) throw redirect(307, '/login')" }), + }), }) diff --git a/configs/nvim/lua/configs/telescope.lua b/configs/nvim/lua/configs/telescope.lua index 1c03898..c3e9b8d 100644 --- a/configs/nvim/lua/configs/telescope.lua +++ b/configs/nvim/lua/configs/telescope.lua @@ -1,63 +1,60 @@ local telescope = require("telescope") -local actions = require("telescope.actions") local trouble = require("trouble.providers.telescope") telescope.setup({ - defaults = {}, + defaults = {}, }) local default = { - defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--ignore-file", - "workerMain.js", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_ignore_patterns = { "node_modules" }, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - mappings = { - i = { [""] = trouble.open_with_trouble }, - n = { [""] = trouble.open_with_trouble }, - }, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - use_less = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - }, + defaults = { + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--ignore-file", + "workerMain.js", + }, + prompt_prefix = "  ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "ascending", + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + results_width = 0.8, + }, + vertical = { + mirror = false, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + file_sorter = require("telescope.sorters").get_fuzzy_file, + file_ignore_patterns = { "node_modules" }, + generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, + path_display = { "truncate" }, + winblend = 0, + border = {}, + mappings = { + i = { [""] = trouble.open_with_trouble }, + n = { [""] = trouble.open_with_trouble }, + }, + borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, + color_devicons = true, + use_less = true, + set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, + file_previewer = require("telescope.previewers").vim_buffer_cat.new, + grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, + qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, + }, } telescope.setup(default) diff --git a/configs/nvim/lua/core/keymappings.lua b/configs/nvim/lua/core/keymappings.lua index 43ba965..dad5bad 100644 --- a/configs/nvim/lua/core/keymappings.lua +++ b/configs/nvim/lua/core/keymappings.lua @@ -1,12 +1,16 @@ -local map = vim.api.nvim_set_keymap +-- local map = vim.api.nvim_set_keymap +local map = vim.keymap.set local g = vim.g +local saga = require("lspsaga") +saga.init_lsp_saga() + local options = { noremap = true, silent = true } local remap = { noremap = false } g.mapleader = " " -map("n", "", ":Telescope git_files", options) +map("n", "", ":Telescope find_files", options) map("n", "", ":lua require'telescope.builtin'.live_grep{ cwd = vim.fn.getcwd() }", options) map("n", "", ":Telescope command_center", options) map("n", "", "za", remap) @@ -16,17 +20,24 @@ map("n", "n", ":lua vim.diagnostic.goto_next()", options) map("n", "p", ":lua vim.diagnostic.goto_prev()", options) map("n", "gD", "lua vim.lsp.buf.declaration()", options) map("n", "gd", "lua vim.lsp.buf.definition()", options) -map("n", "gr", "lua vim.lsp.buf.references()", options) map("n", "gi", "lua vim.lsp.buf.implementation()", options) -map("n", "K", "lua vim.lsp.buf.hover()", options) -map("n", "e", "lua vim.diagnostic.open_float()", options) -map("n", "rn", "lua vim.lsp.buf.rename()", options) -map("n", "c", "lua vim.lsp.buf.code_action()", options) + +map("n", "K", "Lspsaga hover_doc", { silent = true }) +map("n", "o", "LSoutlineToggle", { silent = true }) +map("n", "e", "Lspsaga show_cursor_diagnostics", { silent = true }) +map("n", "rn", "Lspsaga rename", options) +map({ "n", "v" }, "c", "Lspsaga code_action", { silent = true }) +map({ "n", "v" }, "gr", "Lspsaga lsp_finder", options) + map("n", "t", ":TroubleToggle", remap) -- DAP Functionality map("n", "b", ":lua require('dap').toggle_breakpoint()", options) +-- Test Functionality +map("n", "tt", ":lua require('neotest').run.run()", options) +map("n", "to", ":lua require('neotest').summary.open()", options) + -- Navigate Buffers map("n", "", "h", options) map("n", "", "j", options) @@ -39,7 +50,7 @@ map("n", "3", "3gt", options) map("n", "4", "4gt", options) map("n", "0", ":tablast", options) -map("n", "", ":lua require('harpoon.mark').add_file()", options) +map("n", "m", ":lua require('harpoon.mark').add_file()", options) -- Navigate Files map("n", "", ":Telescope harpoon marks", options) diff --git a/configs/nvim/lua/core/plugins.lua b/configs/nvim/lua/core/plugins.lua index 2f0e9fa..72e52ad 100644 --- a/configs/nvim/lua/core/plugins.lua +++ b/configs/nvim/lua/core/plugins.lua @@ -50,13 +50,8 @@ return packer.startup(function(use) require("nvim_comment").setup() end, }) - use({ - "windwp/nvim-autopairs", - config = function() - require("nvim-autopairs").setup() - end, - }) use("gfeiyou/command-center.nvim") + use("glepnir/lspsaga.nvim") -- Code Navigation use("junegunn/fzf") @@ -84,8 +79,12 @@ return packer.startup(function(use) use("neovim/nvim-lspconfig") use("hrsh7th/nvim-cmp") use("onsails/lspkind.nvim") - use({ "tzachar/cmp-tabnine", run = "./install.sh", requires = "hrsh7th/nvim-cmp" }) - -- use({ "hrsh7th/cmp-copilot", requires = "github/copilot.vim" }) + use({ + "windwp/nvim-autopairs", + config = function() + require("nvim-autopairs").setup() + end, + }) use("hrsh7th/cmp-nvim-lsp") use("hrsh7th/cmp-path") use("hrsh7th/cmp-calc") @@ -125,6 +124,8 @@ return packer.startup(function(use) use({ "nvim-neotest/neotest", requires = { + "haydenmeade/neotest-jest", + "KaiSpencer/neotest-vitest", "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim", diff --git a/configs/zsh/functions/conf.zsh b/configs/zsh/functions/conf.zsh index f6fbfc1..9368f61 100644 --- a/configs/zsh/functions/conf.zsh +++ b/configs/zsh/functions/conf.zsh @@ -4,6 +4,9 @@ function conf(){ if [ "$1" = "u" ]; then source ~/.zshrc + elif [ "$1" = "ssh" ]; then + cd $HOME/.ssh/ + nvim config else cd ~/.dotfiles/