diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-12-09 15:59:12 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-12-09 15:59:12 +0200 |
| commit | 05907aa17dd4163d42a9abc64d0fa79aefc2f1bc (patch) | |
| tree | 8cc10fe2ec402d2c2cc283f92787dba561261ca5 | |
| parent | a8d56b91efaebf9a8501f99bf45a3047c4dd72b7 (diff) | |
| download | dotfiles-05907aa17dd4163d42a9abc64d0fa79aefc2f1bc.tar.xz dotfiles-05907aa17dd4163d42a9abc64d0fa79aefc2f1bc.zip | |
Added some new aliases and added some new keymaps to my nvim config
| -rw-r--r-- | aliases/.aliases/aliases | 4 | ||||
| -rw-r--r-- | nvim/.config/nvim/init.lua | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/user/keymaps.lua | 12 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/user/lsp/handlers.lua | 2 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/user/plugins.lua | 26 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/user/telescope.lua | 4 | ||||
| -rw-r--r-- | nvim/.config/nvim/plugin/packer_compiled.lua | 5 | ||||
| -rwxr-xr-x | scripts/.scripts/books.sh | 14 | ||||
| -rwxr-xr-x | scripts/.scripts/cpp_ps.sh | 7 | ||||
| -rwxr-xr-x | scripts/.scripts/power.sh | 12 | ||||
| -rwxr-xr-x | scripts/.scripts/pscontests.sh | 2 |
11 files changed, 77 insertions, 13 deletions
diff --git a/aliases/.aliases/aliases b/aliases/.aliases/aliases index 5da04fe..5622aa8 100644 --- a/aliases/.aliases/aliases +++ b/aliases/.aliases/aliases @@ -1,3 +1,5 @@ +alias nv="neovide" +alias pg="ps auxw | grep -v grep | grep $1" alias gpl="~/.scripts/get_project_lines.sh" alias vcc="~/.scripts/cpp_template.sh" alias kpr="ps aux | fzf | awk '{print $2}' | xargs killall > /dev/null 2> /dev/null" @@ -32,7 +34,7 @@ alias book='/home/omar/.scripts/books.sh' alias btrfsfs="sudo btrfs filesystem df /" alias btrfsli="sudo btrfs su li / -t" alias bupskel='cp -Rf /etc/skel ~/.skel-backup-$(date +%Y.%m.%d-%H.%M.%S)' -alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file +alias ca='nvim ~/.aliases/aliases' # for quickly acssesing aliases alias cb="$EDITOR ~/.bashrc" alias ......='cd ../../../../..' alias .....='cd ../../../..' diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 3d15c1d..1e33b39 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -11,6 +11,8 @@ require('material').setup{ } } +require("telescope").load_extension('harpoon') + require('catppuccin').setup({ transparent_background = true, }) diff --git a/nvim/.config/nvim/lua/user/keymaps.lua b/nvim/.config/nvim/lua/user/keymaps.lua index 07e8a49..f74ac25 100644 --- a/nvim/.config/nvim/lua/user/keymaps.lua +++ b/nvim/.config/nvim/lua/user/keymaps.lua @@ -64,7 +64,7 @@ keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts) -- Jumping quickly between two files -keymap("n", "<leader><leader>", ":bprevious<CR>", opts) +--[[ keymap("n", "<leader><leader>", ":bprevious<CR>", opts) ]] -- Centering after page moves or searching for something keymap("n", "<C-d>", "<C-d>zz", opts) @@ -79,6 +79,16 @@ keymap("n", "<F4>", ":CompetiTestRun<CR>", opts) --sourcing luasnips keymap("n", "<leader><leader>s", "<cmd> source ~/.config/nvim/lua/user/luasnip.lua<CR>", opts) +--telescope harpoon +keymap("n", "<leader>H", ":Telescope harpoon marks<CR>", opts) + +--harpoon +keymap("n", "<leader><leader>h", ":lua require('harpoon.ui').toggle_quick_menu()<CR>", opts) -- show harpoon menu +keymap("n", "<leader><leader>a", ":lua require('harpoon.mark').add_file()<CR>", opts) -- adding a file +keymap("n", "<leader><leader>n", ":lua require('harpoon.ui').nav_next()<CR>", opts) -- next file +keymap("n", "<leader><leader>b", ":lua require('harpoon.ui').nav_prev()<CR>", opts) -- prev file + + -- luasnips vim.keymap.set({ "i", "s" }, "<c-k>", function () diff --git a/nvim/.config/nvim/lua/user/lsp/handlers.lua b/nvim/.config/nvim/lua/user/lsp/handlers.lua index 2baf039..c45f2a9 100644 --- a/nvim/.config/nvim/lua/user/lsp/handlers.lua +++ b/nvim/.config/nvim/lua/user/lsp/handlers.lua @@ -76,7 +76,7 @@ local function lsp_keymaps(bufnr) bufnr, "n", "gl", - '<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>', + '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts ) vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts) diff --git a/nvim/.config/nvim/lua/user/plugins.lua b/nvim/.config/nvim/lua/user/plugins.lua index 2924fe6..2aba7e9 100644 --- a/nvim/.config/nvim/lua/user/plugins.lua +++ b/nvim/.config/nvim/lua/user/plugins.lua @@ -88,6 +88,9 @@ return packer.startup(function(use) use 'ellisonleao/gruvbox.nvim' use { "catppuccin/nvim", as = "catppuccin" } + -- harpoon + use "ThePrimeagen/harpoon" + -- cmp plugins use "hrsh7th/nvim-cmp" -- The completion plugin use "hrsh7th/cmp-buffer" -- buffer completions @@ -108,6 +111,29 @@ return packer.startup(function(use) use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters + --harpoon setup + require("harpoon").setup({ + global_settings = { + -- sets the marks upon calling `toggle` on the ui, instead of require `:w`. + save_on_toggle = false, + + -- saves the harpoon file upon every change. disabling is unrecommended. + save_on_change = true, + + -- sets harpoon to run the command immediately as it's passed to the terminal when calling `sendCommand`. + enter_on_sendcmd = false, + + -- closes any tmux windows harpoon that harpoon creates when you close Neovim. + tmux_autoclose_windows = false, + + -- filetypes that you want to prevent from adding to the harpoon list menu. + excluded_filetypes = { "harpoon" }, + + -- set marks specific to each git branch inside git repository + mark_branch = false, + }}) + + --compitest require('competitest').setup { local_config_file_name = ".competitest.lua", diff --git a/nvim/.config/nvim/lua/user/telescope.lua b/nvim/.config/nvim/lua/user/telescope.lua index 0706b51..9e6b240 100644 --- a/nvim/.config/nvim/lua/user/telescope.lua +++ b/nvim/.config/nvim/lua/user/telescope.lua @@ -87,6 +87,10 @@ telescope.setup { -- builtin picker }, extensions = { + harpoon = { + + + } -- Your extension configuration goes here: -- extension_name = { -- extension_config_key = value, diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua index 5efe217..03eea64 100644 --- a/nvim/.config/nvim/plugin/packer_compiled.lua +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -160,6 +160,11 @@ _G.packer_plugins = { path = "/home/pengu/.local/share/nvim/site/pack/packer/start/gruvbox.nvim", url = "https://github.com/ellisonleao/gruvbox.nvim" }, + harpoon = { + loaded = true, + path = "/home/pengu/.local/share/nvim/site/pack/packer/start/harpoon", + url = "https://github.com/ThePrimeagen/harpoon" + }, ["impatient.nvim"] = { loaded = true, path = "/home/pengu/.local/share/nvim/site/pack/packer/start/impatient.nvim", diff --git a/scripts/.scripts/books.sh b/scripts/.scripts/books.sh index 12741f4..f119107 100755 --- a/scripts/.scripts/books.sh +++ b/scripts/.scripts/books.sh @@ -1,12 +1,12 @@ #!/bin/sh ################################################################## -# ___ __ __ _ -# / _ \ _ __ ___ __ _ _ __ | \/ | __ _ __ _ __| |_ _ -#| | | | '_ ` _ \ / _` | '__| | |\/| |/ _` |/ _` |/ _` | | | | -#| |_| | | | | | | (_| | | | | | | (_| | (_| | (_| | |_| | -# \___/|_| |_| |_|\__,_|_| |_| |_|\__,_|\__, |\__,_|\__ | -# |___/ |___/ -# +# ___ __ __ _ # +# / _ \ _ __ ___ __ _ _ __ | \/ | __ _ __ _ __| |_ _ # +#| | | | '_ ` _ \ / _` | '__| | |\/| |/ _` |/ _` |/ _` | | | | # +#| |_| | | | | | | (_| | | | | | | (_| | (_| | (_| | |_| | # +# \___/|_| |_| |_|\__,_|_| |_| |_|\__,_|\__, |\__,_|\__ | # +# |___/ |___/ # +# # ################################################################## path="/home/pengu/Books/" diff --git a/scripts/.scripts/cpp_ps.sh b/scripts/.scripts/cpp_ps.sh index b2c2600..95b110f 100755 --- a/scripts/.scripts/cpp_ps.sh +++ b/scripts/.scripts/cpp_ps.sh @@ -1,5 +1,5 @@ #!/bin/sh -echo -e "Are you sure? y)es n)o" +echo -e "sure? y)es n)o d)on't open the file" read input if [ "$input" = "y" ]; then mkdir $1 @@ -7,6 +7,9 @@ if [ "$input" = "y" ]; then cp ~/test/cptemplate/main.cpp . nvim main.cpp fi - +if [ "$input" = "d" ]; then + mkdir $1 + cp ~/test/cptemplate/main.cpp $1 +fi diff --git a/scripts/.scripts/power.sh b/scripts/.scripts/power.sh new file mode 100755 index 0000000..8722719 --- /dev/null +++ b/scripts/.scripts/power.sh @@ -0,0 +1,12 @@ +#!/bin/sh + + +CHOICES="poweroff\nreboot" + +CHOICE=$(echo -e $CHOICES | dmenu -l 3) + +systemctl $CHOICE + + + + diff --git a/scripts/.scripts/pscontests.sh b/scripts/.scripts/pscontests.sh index ff4f1e3..3705a7f 100755 --- a/scripts/.scripts/pscontests.sh +++ b/scripts/.scripts/pscontests.sh @@ -7,5 +7,5 @@ mkdir ${REPLY} cd ${REPLY} for p in $PROBLEMS do - echo "y" | ~/.scripts/cpp_ps.sh $p + echo "d" | ~/.scripts/cpp_ps.sh $p done |
