diff --git a/.config/nvim/lua/maps.lua b/.config/nvim/lua/maps.lua index e675aee..a6afe95 100644 --- a/.config/nvim/lua/maps.lua +++ b/.config/nvim/lua/maps.lua @@ -3,33 +3,78 @@ -- License : GPLv3 -- Description : neovim mappings file -vim.keymap.set({ "n", "v" }, "", "", { silent = true }) +vim.keymap.set({ "n", "v" }, "", + "", + { + silent = true, + desc = "leader key" + }) vim.g.mapleader = " " -- Dealing with word wrap -vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", - { expr = true, silent = true }) -vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", - { expr = true, silent = true }) +vim.keymap.set("n", "k", + "v:count == 0 ? 'gk' : 'k'", + { + expr = true, + silent = true, + desc = "Smart up motion" + }) +vim.keymap.set("n", "j", + "v:count == 0 ? 'gj' : 'j'", + { + expr = true, + silent = true, + desc = "Smart down motion" + }) -vim.keymap.set("n", "y", "\"+y") -vim.keymap.set("n", "p", "\"+P") -vim.keymap.set("n", "", "w! | !compiler %") -vim.keymap.set("n", "u", function() require("packer").sync() end) +vim.keymap.set("n", "y", + "\"+y", + { desc = "Yank to clipboard"} +) +vim.keymap.set("n", "p", + "\"+P", + { desc = "Copy from clipboard"} +) +vim.keymap.set("n", "", + "w! | !compiler %", + { desc = "Compile current file using ~/.local/bin/compiler"} +) +vim.keymap.set("n", "u", + function() require("packer").sync() end, + { desc = "Sync packer config and update plugins"} +) -- telescope vim.keymap.set("n", "tf", - function() require("telescope.builtin").find_files() end) + function() require("telescope.builtin").find_files() end, + { desc = "Fuzzy find files" } +) vim.keymap.set("n", "tb", - function() require("telescope.builtin").buffers() end) + function() require("telescope").extensions.file_browser.file_browser() end, + { desc = "Open file browser" } +) +vim.keymap.set("n", "t/", + function() require("telescope.builtin").buffers() end, + { desc = "Grep through buffers" } +) vim.keymap.set("n", "tg", - function() require("telescope.builtin").grep_string() end) + function() require("telescope.builtin").grep_string() end, + { desc = "Grep current word" } +) +vim.keymap.set("n", "th", + function() require("telescope.builtin").help_tags() end, + { desc = "Search through help" } +) vim.keymap.set("n", "tl", - function() require("telescope.builtin").live_grep() end) + function() require("telescope.builtin").live_grep() end, + { desc = "Grep interactively" } +) -- colorscheme -vim.keymap.set("n", "", - function() require("astronomy").toggle_variant() end) +vim.keymap.set("n", "s", + function() require("astronomy").toggle_variant() end, + { desc = "Switch between dark and light colorscheme" } +) -- snippets vim.keymap.set({ "i", "s" }, "", "luasnip-next-choice") diff --git a/.config/nvim/lua/plugin/packer.lua b/.config/nvim/lua/plugin/packer.lua index b1afd3b..8c53feb 100644 --- a/.config/nvim/lua/plugin/packer.lua +++ b/.config/nvim/lua/plugin/packer.lua @@ -29,6 +29,9 @@ packer.init({ removed_sym = '- ', -- The symbol for an unused plugin which was removed moved_sym = '→ ', -- The symbol for a plugin which was moved (e.g. from opt to start) header_sym = '━ ', -- The symbol for the header line in packer's display + open_fn = function() + return require('packer.util').float({ border = "single" }) + end, -- Display in a floating window }, }) @@ -51,7 +54,7 @@ return require("packer").startup(function() config = function() require("plugin.treesitter") end } - -- fuzzy finder + -- telescope use { "nvim-telescope/telescope.nvim", requires = { @@ -61,8 +64,16 @@ return require("packer").startup(function() { "nvim-telescope/telescope-fzf-native.nvim", run = "make" + }, + { + "nvim-telescope/telescope-file-browser.nvim", } }, + config = function() + require("telescope") + require("telescope").load_extension("fzf") + require("telescope").load_extension("file_browser") + end } -- LSP diff --git a/.config/nvim/lua/plugin/telescope.lua b/.config/nvim/lua/plugin/telescope.lua new file mode 100644 index 0000000..10c1cad --- /dev/null +++ b/.config/nvim/lua/plugin/telescope.lua @@ -0,0 +1,22 @@ +-- Author : swytch +-- Created : Monday Dec. 26, 2022 18:39:16 CET +-- License : GPLv3 +-- Description : treesitter config file + +require("telescope").setup { + extensions = { + file_browser = { + theme = "ivy", + -- disables netrw and use telescope-file-browser in its place + hijack_netrw = true, + mappings = { + ["i"] = { + -- your custom insert mode mappings + }, + ["n"] = { + -- your custom normal mode mappings + }, + }, + }, + }, +} diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index f8e20b5..42743de 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -1,11 +1,12 @@ #!/bin/zsh # This file is sourced when launching a DM from startx/xinit -# path + +# environment variables +## path export PATH="$(find $HOME/.local/bin -type d | tr '\n' ':' | sed 's/:$//'):$PATH" source "$XDG_DATA_HOME/cargo/env" -# environment variables ## custom paths export DOTFILES="$HOME/.dotfiles.git" export LATEX_RESOURCES="$HOME/documents/latex"