diff --git a/.editorconfig b/.editorconfig index 536a549..2ef185d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,8 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true +indent_size = 4 +indent_style = space [*.lua] indent_style = space diff --git a/xdg_config/alacritty/alacritty.toml b/xdg_config/alacritty/alacritty.toml index 5c140e6..7dab169 100644 --- a/xdg_config/alacritty/alacritty.toml +++ b/xdg_config/alacritty/alacritty.toml @@ -47,5 +47,5 @@ white = '#ECEFF4' [keyboard] bindings = [ - { key = "f", mods = "Control", action = "ToggleViMode" } + { key = ".", mods = "Control", action = "ToggleViMode" } ] diff --git a/xdg_config/git/config b/xdg_config/git/config index 9704d0e..756b70d 100644 --- a/xdg_config/git/config +++ b/xdg_config/git/config @@ -1,8 +1,16 @@ [filter "lfs"] - clean = git-lfs clean -- %f - smudge = git-lfs smudge -- %f - process = git-lfs filter-process - required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true [user] - name = nomutin - email = nomura0508@icloud.com + name = nomutin + email = nomura0508@icloud.com +[core] + editor = nvim +[diff] + tool = vimdiff +[difftool] + prompt = false +[difftool "vimdiff"] + cmd = nvim -d $LOCAL $BASE -c '$wincmd w' -c 'wincmd J' diff --git a/xdg_config/nvim/init.lua b/xdg_config/nvim/init.lua index 81068af..960f57b 100644 --- a/xdg_config/nvim/init.lua +++ b/xdg_config/nvim/init.lua @@ -1,8 +1,9 @@ -- Minimalist neovim configuration by @nomutin --- ====== OPTIONS ====== +-- ====== BUILTIN ====== vim.loader.enable() vim.g.mapleader = " " + vim.g.netrw_banner = 0 vim.g.netrw_liststyle = 3 vim.g.netrw_browse_split = 4 @@ -10,6 +11,8 @@ vim.g.showhide = 1 vim.g.netrw_altv = 1 vim.g.netrw_winsize = -28 vim.g.netrw_keepdir = 1 +vim.g.netrw_preview = 1 + vim.opt.title = true vim.opt.termguicolors = true vim.opt.clipboard = "unnamedplus" @@ -29,15 +32,11 @@ vim.opt.scrolloff = 8 vim.opt.sidescrolloff = 8 vim.opt.laststatus = 3 vim.opt.list = true -vim.api.nvim_set_hl(0, "Function", { fg = "NvimLightBlue" }) --- ====== KEYMAP ====== +vim.api.nvim_set_hl(0, "Function", { fg = "NvimLightBlue" }) vim.keymap.set("i", "jk", "", { desc = "Return to normal mode" }) -vim.keymap.set("t", "fd", [[]], { desc = "Return to normal mode" }) +vim.keymap.set("t", "fd", [[]]) vim.keymap.set("n", "n", "Lexplore", { desc = "Open file explorer" }) -vim.keymap.set("n", "e", "Telescope find_files", { desc = "Find files" }) -vim.keymap.set({ "n", "x", "o" }, "s", "lua require('flash').jump()", { desc = "Jump" }) -vim.keymap.set({ "n", "x", "o" }, "S", "lua require('flash').treesitter()", { desc = "Select" }) -- ====== PLUGIN ====== local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" @@ -49,7 +48,13 @@ vim.opt.rtp:prepend(lazypath) require("lazy").setup({ { "github/copilot.vim", event = "BufRead" }, - { "folke/flash.nvim" }, + { + "folke/flash.nvim", + keys = { + { "s", mode = { "n", "x", "o" }, "lua require('flash').jump()", desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, "lua require('flash').treesitter()", desc = "Flash Treesitter" }, + }, + }, { "lewis6991/gitsigns.nvim", event = "BufRead", opts = {} }, { "nvim-lualine/lualine.nvim", event = "BufRead", opts = {} }, { @@ -84,6 +89,13 @@ require("lazy").setup({ main = "nvim-treesitter.configs", opts = { highlight = { enable = true }, indent = { enable = true } }, }, - { "nvim-telescope/telescope.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, + { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + { "f", "Telescope find_files", { desc = "Find files" } }, + { "g", "Telescope live_grep", { desc = "Live Grep" } }, + }, + }, defaults = { lazy = true }, }) diff --git a/xdg_config/zellij/config.kdl b/xdg_config/zellij/config.kdl index ca054f2..8facf52 100644 --- a/xdg_config/zellij/config.kdl +++ b/xdg_config/zellij/config.kdl @@ -57,15 +57,15 @@ keybinds { bind "b" { BreakPane; SwitchToMode "Normal"; } bind "]" { BreakPaneRight; SwitchToMode "Normal"; } bind "[" { BreakPaneLeft; SwitchToMode "Normal"; } - bind "1" { GoToTab 1; SwitchToMode "Normal"; } - bind "2" { GoToTab 2; SwitchToMode "Normal"; } - bind "3" { GoToTab 3; SwitchToMode "Normal"; } - bind "4" { GoToTab 4; SwitchToMode "Normal"; } - bind "5" { GoToTab 5; SwitchToMode "Normal"; } - bind "6" { GoToTab 6; SwitchToMode "Normal"; } - bind "7" { GoToTab 7; SwitchToMode "Normal"; } - bind "8" { GoToTab 8; SwitchToMode "Normal"; } - bind "9" { GoToTab 9; SwitchToMode "Normal"; } + // bind "1" { GoToTab 1; SwitchToMode "Normal"; } + // bind "2" { GoToTab 2; SwitchToMode "Normal"; } + // bind "3" { GoToTab 3; SwitchToMode "Normal"; } + // bind "4" { GoToTab 4; SwitchToMode "Normal"; } + // bind "5" { GoToTab 5; SwitchToMode "Normal"; } + // bind "6" { GoToTab 6; SwitchToMode "Normal"; } + // bind "7" { GoToTab 7; SwitchToMode "Normal"; } + // bind "8" { GoToTab 8; SwitchToMode "Normal"; } + // bind "9" { GoToTab 9; SwitchToMode "Normal"; } bind "Tab" { ToggleTab; } } scroll { @@ -146,18 +146,18 @@ keybinds { } shared_except "locked" { bind "Ctrl g" { SwitchToMode "Locked"; } - bind "Ctrl q" { Quit; } - bind "Alt n" { NewPane; } - bind "Alt i" { MoveTab "Left"; } - bind "Alt o" { MoveTab "Right"; } - bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } - bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } - bind "Alt j" "Alt Down" { MoveFocus "Down"; } - bind "Alt k" "Alt Up" { MoveFocus "Up"; } - bind "Alt =" "Alt +" { Resize "Increase"; } - bind "Alt -" { Resize "Decrease"; } - bind "Alt [" { PreviousSwapLayout; } - bind "Alt ]" { NextSwapLayout; } + // bind "Ctrl q" { Quit; } + // bind "Alt n" { NewPane; } + // bind "Alt i" { MoveTab "Left"; } + // bind "Alt o" { MoveTab "Right"; } + // bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + // bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; } + // bind "Alt j" "Alt Down" { MoveFocus "Down"; } + // bind "Alt k" "Alt Up" { MoveFocus "Up"; } + // bind "Alt =" "Alt +" { Resize "Increase"; } + // bind "Alt -" { Resize "Decrease"; } + // bind "Alt [" { PreviousSwapLayout; } + // bind "Alt ]" { NextSwapLayout; } } shared_except "normal" "locked" { bind "Enter" "Esc" { SwitchToMode "Normal"; } @@ -199,185 +199,23 @@ plugins { } } -// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP -// eg. when terminal window with an active zellij session is closed -// Options: -// - detach (Default) -// - quit -// -// on_force_close "quit" - -// Send a request for a simplified ui (without arrow fonts) to plugins -// Options: -// - true -// - false (Default) -// simplified_ui true -// Choose the path to the default shell that zellij will use for opening new panes -// Default: $SHELL -// -// default_shell "fish" - -// Choose the path to override cwd that zellij will use for opening new panes -// -// default_cwd "" - -// Toggle between having pane frames around the panes -// Options: -// - true (default) -// - false -// -// pane_frames true - -// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible -// Options: -// - true (default) -// - false -// -// auto_layout true - -// Whether sessions should be serialized to the cache folder (including their tabs/panes, cwds and running commands) so that they can later be resurrected -// Options: -// - true (default) -// - false -// -// session_serialization false - -// Whether pane viewports are serialized along with the session, default is false -// Options: -// - true -// - false (default) -// serialize_pane_viewport true - -// Scrollback lines to serialize along with the pane viewport when serializing sessions, 0 -// defaults to the scrollback size. If this number is higher than the scrollback size, it will -// also default to the scrollback size. This does nothing if `serialize_pane_viewport` is not true. -// -// scrollback_lines_to_serialize 10000 - -// Define color themes for Zellij -// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes -// Once these themes are defined, one of them should to be selected in the "theme" section of this file -// -// themes { -// dracula { -// fg 248 248 242 -// bg 40 42 54 -// red 255 85 85 -// green 80 250 123 -// yellow 241 250 140 -// blue 98 114 164 -// magenta 255 121 198 -// orange 255 184 108 -// cyan 139 233 253 -// black 0 0 0 -// white 255 255 255 -// } -// } - themes { - nord_me { - fg 216 222 233 // #D8DEE9 - bg 46 52 64 // #2E3440 - black 59 66 82 // #3B4252 - red 191 97 106 // #BF616A + my_nord { + fg 216 222 233 + bg 46 52 64 + black 59 66 82 + red 191 97 106 green "#89b4fa" - yellow 235 203 139 // #EBCB8B - blue 129 161 193 // #81A1C1 - magenta 180 142 173 // #B48EAD - cyan 136 192 208 // #88C0D0 - white 229 233 240 // #E5E9F0 - orange 208 135 112 // #D08770 + yellow 235 203 139 + blue 129 161 193 + magenta 180 142 173 + cyan 136 192 208 + white 229 233 240 + orange 208 135 112 } } -// Choose the theme that is specified in the themes section. -// Default: default -// -theme "nord_me" - - -// The name of the default layout to load on startup -// Default: "default" -// -default_layout "compact" - -// Choose the mode that zellij uses when starting up. -// Default: normal -// -// default_mode "locked" - -// Toggle enabling the mouse mode. -// On certain configurations, or terminals this could -// potentially interfere with copying text. -// Options: -// - true (default) -// - false -// -// mouse_mode false - -// Configure the scroll back buffer size -// This is the number of lines zellij stores for each pane in the scroll back -// buffer. Excess number of lines are discarded in a FIFO fashion. -// Valid values: positive integers -// Default value: 10000 -// -// scroll_buffer_size 10000 - -// Provide a command to execute when copying text. The text will be piped to -// the stdin of the program to perform the copy. This can be used with -// terminal emulators which do not support the OSC 52 ANSI control sequence -// that will be used by default if this option is not set. -// Examples: -// -// copy_command "xclip -selection clipboard" // x11 -// copy_command "wl-copy" // wayland -// copy_command "pbcopy" // osx - -// Choose the destination for copied text -// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard. -// Does not apply when using copy_command. -// Options: -// - system (default) -// - primary -// -// copy_clipboard "primary" - -// Enable or disable automatic copy (and clear) of selection when releasing mouse -// Default: true -// -// copy_on_select false - -// Path to the default editor to use to edit pane scrollbuffer -// Default: $EDITOR or $VISUAL -// -// scrollback_editor "/usr/bin/vim" - -// When attaching to an existing session with other users, -// should the session be mirrored (true) -// or should each user have their own cursor (false) -// Default: false -// -// mirror_session true - -// The folder in which Zellij will look for layouts -// -// layout_dir "/path/to/my/layout_dir" - -// The folder in which Zellij will look for themes -// -// theme_dir "/path/to/my/theme_dir" - -// Enable or disable the rendering of styled and colored underlines (undercurl). -// May need to be disabled for certain unsupported terminals -// Default: true -// -// styled_underlines false - -// Enable or disable writing of session metadata to disk (if disabled, other sessions might not know -// metadata info on this session) -// Default: false -// -// disable_session_metadata true - +theme "my_nord" +default_layout "my-default" diff --git a/xdg_config/zellij/layouts/ml.kdl b/xdg_config/zellij/layouts/ml.kdl new file mode 100644 index 0000000..4cbbc25 --- /dev/null +++ b/xdg_config/zellij/layouts/ml.kdl @@ -0,0 +1,41 @@ + +layout { + + tab name="$HOME" cwd="$HOME" hide_floating_panes=true { + floating_panes { + pane x="6%" y="3%" width="88%" height="88%" + } + + pane + pane size=1 borderless=true { + plugin location="compact-bar" + } + } + + tab name="$PWD" hide_floating_panes=true { + floating_panes { + pane x="6%" y="3%" width="88%" height="88%" command="lazygit" + } + pane size="65%" split_direction="vertical" { + pane name="EDITOR" command="bash" { + args "-c" "bash --rcfile <(cat ~/.bashrc; echo 'source .venv/bin/activate';)" + } + pane split_direction="horizontal" { + pane name="WORK#1" size="45%" command="bash" { + args "-c" "bash --rcfile <(cat ~/.bashrc; echo 'source .venv/bin/activate';)" + } + pane name="WORK#2" size="45%" command="bash" { + args "-c" "bash --rcfile <(cat ~/.bashrc; echo 'source .venv/bin/activate';)" + } + pane name="SERVER" size="10%" { + command "python" + args "-m" "http.server" "8000" + } + } + } + pane size=1 borderless=true { + plugin location="compact-bar" + } + } + +} diff --git a/xdg_config/zellij/layouts/my-default.kdl b/xdg_config/zellij/layouts/my-default.kdl new file mode 100644 index 0000000..710dbe6 --- /dev/null +++ b/xdg_config/zellij/layouts/my-default.kdl @@ -0,0 +1,33 @@ +layout { + + tab name="$HOME" cwd="$HOME" { + pane + pane size=1 borderless=true { + plugin location="compact-bar" + } + } + + tab name="$PWD" hide_floating_panes=true { + floating_panes { + pane { + x "6%" + y "3%" + width "88%" + height "88%" + } + } + pane split_direction="vertical" { + pane size="65%" + pane { + pane { + command "ls" + args "-la" + } + } + } + pane size=1 borderless=true { + plugin location="compact-bar" + } + } + +}