diff --git a/config/hypr/exec-start.conf b/config/hypr/exec-start.conf index 8d88c82..12ebae0 100644 --- a/config/hypr/exec-start.conf +++ b/config/hypr/exec-start.conf @@ -1,12 +1,14 @@ # Executable Startup File for Hyprland #exec-once=uclampset -M 10 waybar -exec-once=eww open bar -exec-once=swayidle -exec-once=hyprpaper +exec-once=${XDG_CONFIG_HOME:-~/.config}/dunst/scripts/low-battery.sh +exec-once=aw-server +exec-once=awatcher exec-once=dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus exec-once=dunst -exec-once=${XDG_CONFIG_HOME:-~/.config}/dunst/scripts/low-battery.sh +exec-once=eww open bar exec-once=fcitx5 -#exec-once=~/.config/hypr/portal.sh +exec-once=foot -s +exec-once=hyprpaper +exec-once=swayidle exec-once=systemctl --user import-environment DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once=wl-paste -t text --watch clipman store --no-persist diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 338c415..90b1f5e 100755 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -1,25 +1,6 @@ " (Neo)vim Configuration " By Flying_Stitchman 4 Jan 2022 -" Move this to the keymap file at some point later -inoremap jk -xnoremap gy "+y -let mapleader = " " -" fast move -noremap J 6j -noremap K 6k -noremap H BufferLineCyclePrev -noremap L BufferLineCycleNext -" Moving between windows -noremap h -noremap j -noremap k -noremap l -" fix it -noremap gh K -noremap M J -tnoremap - " nvim builtin option config luafile /etc/nixos/config/nvim/lua/options.lua " nvim keymapping diff --git a/config/nvim/lua/keymap.lua b/config/nvim/lua/keymap.lua new file mode 100644 index 0000000..d397bdd --- /dev/null +++ b/config/nvim/lua/keymap.lua @@ -0,0 +1,82 @@ +-- Keymap File +local map = vim.keymap.set + +-- jk exit from insert mode +map("i", "jk", "noh", { silent = true }) + +---- +-- Movements +---- + +-- More powerful J and K (use 6j/6k) +-- Via Pseudometa (https://nanotipsforvim.prose.sh/motion-setup--hjkl-as-amplified-hjkl) +map({ "n", "x" }, "", "6j") +map({ "n", "x" }, "", "6k") + +-- And fix the keys to other ones +map({ "n", "x" }, "M", "J", { desc = "Merge" }) -- Replace the join command +map("n", "gh", vim.lsp.buf.hover, { desc = "Hover" }) -- Code action hover + + +-- Move to window using the hjkl keys +map("n", "", "h", { desc = "Go to left window", remap = true }) +map("n", "", "j", { desc = "Go to lower window", remap = true }) +map("n", "", "k", { desc = "Go to upper window", remap = true }) +map("n", "", "l", { desc = "Go to right window", remap = true }) + +-- Move between buffers +map("n", "", "BufferLineCyclePrev", { desc = "Move buffer left", silent = true }) +map("n", "", "BufferLineCycleNext", { desc = "Move buffer right", silent = true }) +map("n", "<", "BufferLineMovePrev", { desc = "Move buffer left", silent = true }) +map("n", ">", "BufferLineMoveNext", { desc = "Move buffer right", silent = true }) + +-- ToggleTerm Bindings +map("n", "a", "ToggleTerm name=main", { desc = "Floating Terminal", silent = true }) + +---- +-- Cool Macros +---- + +-- Quit All +map("n", "qq", "qa", { desc = "Quit all" }) + +-- Copy and paste from system clipboard +map({ "n", "x" }, "y", '"+y', { desc = "Yank to system clipboard", silent = true }) +map({ "n", "x" }, "p", '"+p', { desc = "Paste after from system clipboard", silent = true }) +map({ "n", "x" }, "P", '"+P', { desc = "Paste before from system clipboard", silent = true }) + +-- Neotree +map("n", "e", function() + require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() }) +end, { desc = "Open Neotree", remap = true }) + +---- +-- Fixes +---- + +-- Proper Wrap Navigation +map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map({ "n", "x" }, "", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +map({ "n", "x" }, "", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + +-- Auto Re-highlight After Indent +map("v", "<", "", ">gv") + +-- Saner Movement of nN +map("n", "n", "'Nn'[v:searchforward].'zv'.'zz'", { expr = true, desc = "Next search result" }) +map("x", "n", "'Nn'[v:searchforward].'zz'", { expr = true, desc = "Next search result" }) +map("o", "n", "'Nn'[v:searchforward].'zz'", { expr = true, desc = "Next search result" }) +map("n", "N", "'nN'[v:searchforward].'zv'.'zz'", { expr = true, desc = "Prev search result" }) +map("x", "N", "'nN'[v:searchforward].'zz'", { expr = true, desc = "Prev search result" }) +map("o", "N", "'nN'[v:searchforward].'zz'", { expr = true, desc = "Prev search result" }) + +-- Terminal Mappings +map("t", "", "", { desc = "Enter Normal Mode" }) +map("t", "", "wincmd h", { desc = "Go to left window" }) +map("t", "", "wincmd j", { desc = "Go to lower window" }) +map("t", "", "wincmd k", { desc = "Go to upper window" }) +map("t", "", "wincmd l", { desc = "Go to right window" }) +map("t", "", "close", { desc = "Hide Terminal" }) +map("t", "", "close", { desc = "which_key_ignore" }) diff --git a/config/nvim/lua/options.lua b/config/nvim/lua/options.lua index b4775ce..1029b8e 100644 --- a/config/nvim/lua/options.lua +++ b/config/nvim/lua/options.lua @@ -2,13 +2,19 @@ local opt = vim.opt +-- Leader key +vim.g.mapleader = " " +vim.g.maplocalleader = "\\" + -- Basic Options I like opt.hlsearch = true opt.ignorecase = true opt.relativenumber = true +opt.number = true opt.spell = true opt.swapfile = false opt.syntax = "on" +opt.scrolloff = 15 -- Had this disabled before might not like opt.incsearch = true @@ -18,7 +24,7 @@ opt.termguicolors = true -- Good indents opt.tabstop = 2 -opt.shiftwidth = 2 +opt.shiftwidth = 0 -- Use tabstop opt.expandtab = true -- Show trailing whitespace but fancy diff --git a/config/nvim/nvim.lua b/config/nvim/nvim.lua index 6337283..1cccdac 100644 --- a/config/nvim/nvim.lua +++ b/config/nvim/nvim.lua @@ -121,11 +121,18 @@ require("bufferline").setup({ options = { }, }, },}) -require("ibl").setup() require("gitsigns").setup() -require("which-key").setup({ global = false }) -require("telescope").setup() +require("ibl").setup() +require("mini.comment").setup() require("neo-tree").setup() +require("telescope").setup() +require("toggleterm").setup{ + direction = 'float', + float_opts = { + border = 'curved', + }, +} +require("which-key").setup({ global = false }) require("spaceman").setup({ workspaces = { "/etc/nixos", @@ -142,6 +149,3 @@ require("spaceman").setup({ } }) -vim.keymap.set("n", "e", function() - require("neo-tree.command").execute({ action = "show", position = "right", toggle = true, dir = vim.loop.cwd() }) -end, { desc = "Open Neotree", remap = true }) diff --git a/packages/default.nix b/packages/default.nix index b163a34..18d8eed 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -104,11 +104,13 @@ in indent-blankline-nvim lazy-nvim luasnip + mini-nvim neo-tree-nvim nvim-cmp nvim-lspconfig spaceman-nvim telescope-nvim + toggleterm-nvim tokyonight-nvim typst-vim vim-lsp-cxx-highlight