From 3802a2e1a1e4dd4074bacf49e13dddf6c4e56ab2 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Tue, 23 Apr 2024 11:26:27 +0930 Subject: [PATCH] feat: add tmux.conf --- .config/alacritty/alacritty.toml | 2 +- .config/nvim/lua/settings/theme.lua | 4 +- .config/nvim/lua/tovi/core/autocmd.lua | 2 +- .config/nvim/lua/tovi/core/remaps.lua | 6 -- .config/nvim/lua/tovi/plugins/colorscheme.lua | 52 ++++++++++++++- .config/nvim/lua/tovi/plugins/harpoon.lua | 38 +++++------ .../nvim/lua/tovi/plugins/lsp/lspconfig.lua | 15 ++--- .config/nvim/lua/tovi/plugins/tmux.lua | 10 +++ .config/tmux/plugins/tmux | 1 + .config/tmux/plugins/tmux-sensible | 1 + .config/tmux/plugins/tmux-tokyo-night | 1 + .config/tmux/plugins/tpm | 1 + .config/tmux/tmux.conf | 63 +++++++++++++++++++ 13 files changed, 153 insertions(+), 43 deletions(-) create mode 100644 .config/nvim/lua/tovi/plugins/tmux.lua create mode 160000 .config/tmux/plugins/tmux create mode 160000 .config/tmux/plugins/tmux-sensible create mode 160000 .config/tmux/plugins/tmux-tokyo-night create mode 160000 .config/tmux/plugins/tpm create mode 100644 .config/tmux/tmux.conf diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index 02ea36e..2c77030 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -import = ["/home/tovi/.config/alacritty/themes/carbonfox.toml.toml"] +# import = ["/home/tovi/.config/alacritty/themes/carbonfox.toml.toml"] [font] size = 11 diff --git a/.config/nvim/lua/settings/theme.lua b/.config/nvim/lua/settings/theme.lua index 23630e0..6cde2b9 100644 --- a/.config/nvim/lua/settings/theme.lua +++ b/.config/nvim/lua/settings/theme.lua @@ -1,5 +1,5 @@ -- Themery block -- This block will be replaced by Themery. -vim.cmd("colorscheme eldritch") -vim.g.theme_id = 12 +vim.cmd("colorscheme catppuccin") +vim.g.theme_id = 5 -- end themery block diff --git a/.config/nvim/lua/tovi/core/autocmd.lua b/.config/nvim/lua/tovi/core/autocmd.lua index 1f6112a..2d6aabd 100644 --- a/.config/nvim/lua/tovi/core/autocmd.lua +++ b/.config/nvim/lua/tovi/core/autocmd.lua @@ -2,7 +2,7 @@ local aucmd_dict = { FileType = { { -- Set tabstop to 2 for Dart, Vue, JavaScript, TypeScript, and JSON files - pattern = "dart,vue,javascript,typescript,json", + pattern = "dart,vue,javascript,typescript,json,markdown", callback = function() vim.opt_local.tabstop = 2 vim.opt_local.softtabstop = 2 diff --git a/.config/nvim/lua/tovi/core/remaps.lua b/.config/nvim/lua/tovi/core/remaps.lua index 48b465f..c698714 100644 --- a/.config/nvim/lua/tovi/core/remaps.lua +++ b/.config/nvim/lua/tovi/core/remaps.lua @@ -9,12 +9,6 @@ vim.keymap.set("v", "K", ":m '<-2gv=gv") vim.keymap.set("n", "hs", "split", { desc = "Open horizontal spilt" }) vim.keymap.set("n", "vs", "vsplit", { desc = "Open vertical spilt" }) --- Easily navigate splits -vim.keymap.set("n", "", "h", { desc = "Move focus to split left" }) -vim.keymap.set("n", "", "j", { desc = "Move focus to split down" }) -vim.keymap.set("n", "", "k", { desc = "Move focus to split up" }) -vim.keymap.set("n", "", "l", { desc = "Move focus to split right" }) - -- Copy the entire file vim.keymap.set("n", "y", "ggyG", { desc = "Copy the entire file to default register" }) diff --git a/.config/nvim/lua/tovi/plugins/colorscheme.lua b/.config/nvim/lua/tovi/plugins/colorscheme.lua index a546078..f2d4767 100644 --- a/.config/nvim/lua/tovi/plugins/colorscheme.lua +++ b/.config/nvim/lua/tovi/plugins/colorscheme.lua @@ -38,7 +38,57 @@ return { { "catppuccin/nvim", name = "catppuccin", - priority = 1000 + priority = 1000, + config = function () + require("catppuccin").setup({ + flavour = "auto", -- latte, frappe, macchiato, mocha + background = { -- :h background + light = "latte", + dark = "mocha", + }, + transparent_background = false, -- disables setting the background color. + show_end_of_buffer = false, -- shows the '~' characters after the end of buffers + term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`) + dim_inactive = { + enabled = false, -- dims the background color of inactive window + shade = "dark", + percentage = 0.15, -- percentage of the shade to apply to the inactive window + }, + no_italic = false, -- Force no italic + no_bold = false, -- Force no bold + no_underline = false, -- Force no underline + styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): + comments = { "italic" }, -- Change the style of comments + conditionals = { "italic" }, + loops = {}, + functions = {}, + keywords = {}, + strings = {}, + variables = {}, + numbers = {}, + booleans = {}, + properties = {}, + types = {}, + operators = {}, + -- miscs = {}, -- Uncomment to turn off hard-coded styles + }, + color_overrides = {}, + custom_highlights = {}, + default_integrations = true, + integrations = { + cmp = true, + gitsigns = true, + nvimtree = true, + treesitter = true, + notify = false, + mini = { + enabled = true, + indentscope_color = "", + }, + -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) + }, + }) + end }, { "rebelot/kanagawa.nvim", diff --git a/.config/nvim/lua/tovi/plugins/harpoon.lua b/.config/nvim/lua/tovi/plugins/harpoon.lua index 17d758d..24162ec 100644 --- a/.config/nvim/lua/tovi/plugins/harpoon.lua +++ b/.config/nvim/lua/tovi/plugins/harpoon.lua @@ -22,28 +22,20 @@ return { harpoon.ui:toggle_quick_menu(harpoon:list()) end, { desc = "Toggle quick menu for harpoon" }) - keymap.set("n", "", function() - harpoon:list():prev() - end, { desc = "Go to previous harpoon mark" }) - - keymap.set("n", "", function() - harpoon:list():next() - end, { desc = "Go to next harpoon mark" }) - - keymap.set("n", "", function() - harpoon:list():select(1) - end, { desc = "Go to first harpoon file" }) - - keymap.set("n", "", function() - harpoon:list():select(2) - end, { desc = "Go to second harpoon file" }) - - keymap.set("n", "", function() - harpoon:list():select(3) - end, { desc = "Go to third harpoon file" }) - - keymap.set("n", "", function() - harpoon:list():select(4) - end, { desc = "Go to fourth harpoon file" }) + -- keymap.set("n", "", function() + -- harpoon:list():select(1) + -- end, { desc = "Go to first harpoon file" }) + -- + -- keymap.set("n", "", function() + -- harpoon:list():select(2) + -- end, { desc = "Go to second harpoon file" }) + -- + -- keymap.set("n", "", function() + -- harpoon:list():select(3) + -- end, { desc = "Go to third harpoon file" }) + -- + -- keymap.set("n", "", function() + -- harpoon:list():select(4) + -- end, { desc = "Go to fourth harpoon file" }) end, } diff --git a/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua b/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua index bd2d7e0..fb274a0 100644 --- a/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua +++ b/.config/nvim/lua/tovi/plugins/lsp/lspconfig.lua @@ -114,17 +114,14 @@ return { lspconfig["tsserver"].setup({ capabilities = capabilities, on_attach = on_attach, - filetypes = { "vue" }, + filetypes = { "typescript", "vue" }, init_options = { - tsdk = '/usr/local/lib/node_modules/typescript/lib', - plugins = { - { - name = "@vue/typescript-plugin", - location = "/usr/local/lib/node_modules/@vue/typescript-plugin", - languages = {"javascript", "typescript", "vue"}, - }, + { + name = "@vue/typescript-plugin", + location = "/usr/local/lib/node_modules/@vue/typescript-plugin", + languages = {"javascript", "typescript", "vue"}, }, - }, + } }) -- configure css server diff --git a/.config/nvim/lua/tovi/plugins/tmux.lua b/.config/nvim/lua/tovi/plugins/tmux.lua new file mode 100644 index 0000000..cea9515 --- /dev/null +++ b/.config/nvim/lua/tovi/plugins/tmux.lua @@ -0,0 +1,10 @@ +return { + "aserowy/tmux.nvim", + config = function () + require("tmux").setup({ + copy_sync = { + enable = false + }, + }) + end +} diff --git a/.config/tmux/plugins/tmux b/.config/tmux/plugins/tmux new file mode 160000 index 0000000..a556353 --- /dev/null +++ b/.config/tmux/plugins/tmux @@ -0,0 +1 @@ +Subproject commit a556353d60833367b13739e660d4057a96f2f4fe diff --git a/.config/tmux/plugins/tmux-sensible b/.config/tmux/plugins/tmux-sensible new file mode 160000 index 0000000..25cb91f --- /dev/null +++ b/.config/tmux/plugins/tmux-sensible @@ -0,0 +1 @@ +Subproject commit 25cb91f42d020f675bb0a2ce3fbd3a5d96119efa diff --git a/.config/tmux/plugins/tmux-tokyo-night b/.config/tmux/plugins/tmux-tokyo-night new file mode 160000 index 0000000..ee73d4a --- /dev/null +++ b/.config/tmux/plugins/tmux-tokyo-night @@ -0,0 +1 @@ +Subproject commit ee73d4a9ba6222d7d51492a4e0e797c9249a879c diff --git a/.config/tmux/plugins/tpm b/.config/tmux/plugins/tpm new file mode 160000 index 0000000..99469c4 --- /dev/null +++ b/.config/tmux/plugins/tpm @@ -0,0 +1 @@ +Subproject commit 99469c4a9b1ccf77fade25842dc7bafbc8ce9946 diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf new file mode 100644 index 0000000..5d0c5e5 --- /dev/null +++ b/.config/tmux/tmux.conf @@ -0,0 +1,63 @@ +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' + +set -g @plugin 'catppuccin/tmux' +# set -g @plugin 'fabioluciano/tmux-tokyo-night' + +# Colour scheme +# set -g @theme_variation 'moon' +# set -g @theme_left_separator ' ' +# set -g @theme_right_separator ' ' + +set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha +set -g @catppuccin_status_left_separator " " +set -g @catppuccin_status_right_separator "" + +# easy reload config +bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "~/.config/tmux/tmux.conf reloaded." + +set-option -g status-position top + +# set window split +bind-key v split-window -h +bind-key b split-window + +# C-b is not acceptable -- Vim uses it +set-option -g prefix C-a +bind-key C-a last-window + +# Start numbering at 1 +set -g base-index 1 + +# Allows for faster key repetition +set -s escape-time 50 + +# Rather than constraining window size to the maximum size of any client +# connected to the *session*, constrain window size to the maximum size of any +# client connected to *that window*. Much more reasonable. +setw -g aggressive-resize on + +is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?\.?(view|n?vim?x?)(-wrapped)?(diff)?$'" + +bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' { if -F '#{pane_at_left}' '' 'select-pane -L' } +bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' { if -F '#{pane_at_bottom}' '' 'select-pane -D' } +bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' { if -F '#{pane_at_top}' '' 'select-pane -U' } +bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' { if -F '#{pane_at_right}' '' 'select-pane -R' } + +bind-key -T copy-mode-vi 'C-h' if -F '#{pane_at_left}' '' 'select-pane -L' +bind-key -T copy-mode-vi 'C-j' if -F '#{pane_at_bottom}' '' 'select-pane -D' +bind-key -T copy-mode-vi 'C-k' if -F '#{pane_at_top}' '' 'select-pane -U' +bind-key -T copy-mode-vi 'C-l' if -F '#{pane_at_right}' '' 'select-pane -R' + +bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" + +set-window-option -g mode-keys vi + +bind 'V' copy-mode + +# Enable mouse control (clickable windows, panes, resizable panes) +set -g mouse on + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm'