From 79957ef1c0619bc6c18dc36e6fd46e220acf3e33 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Wed, 5 Jun 2024 08:36:36 +0930 Subject: [PATCH 1/5] feat: change theme to kanagawa --- .config/alacritty/alacritty.toml | 2 +- .config/alacritty/themes/kanagawa_dragon.toml | 38 ++++ .config/alacritty/themes/kanagawa_wave.toml | 38 ++++ .config/nvim/lua/tovi/plugins/colorscheme.lua | 163 +++++++++++------- .config/nvim/lua/tovi/plugins/lualine.lua | 2 +- .config/nvim/lua/tovi/plugins/tmux.lua | 5 + .tmux.conf | 10 +- 7 files changed, 191 insertions(+), 67 deletions(-) create mode 100644 .config/alacritty/themes/kanagawa_dragon.toml create mode 100644 .config/alacritty/themes/kanagawa_wave.toml diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index da30d14..223ce39 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -1,5 +1,5 @@ import = [ - "~/.config/alacritty/themes/gruvbox_dark.toml" + "~/.config/alacritty/themes/kanagawa_wave.toml" ] [env] diff --git a/.config/alacritty/themes/kanagawa_dragon.toml b/.config/alacritty/themes/kanagawa_dragon.toml new file mode 100644 index 0000000..a3dc784 --- /dev/null +++ b/.config/alacritty/themes/kanagawa_dragon.toml @@ -0,0 +1,38 @@ +# Colors (Kanagawa Dragon) +# Source https//github.com/rebelot/kanagawa.nvim + +[colors.primary] +background = '#181616' +foreground = '#c5c9c5' + +[colors.normal] +black = '#0d0c0c' +blue = '#8ba4b0' +cyan = '#8ea4a2' +green = '#8a9a7b' +magenta = '#a292a3' +red = '#c4746e' +white = '#C8C093' +yellow = '#c4b28a' + +[colors.bright] +black = '#a6a69c' +blue = '#7FB4CA' +cyan = '#7AA89F' +green = '#87a987' +magenta = '#938AA9' +red = '#E46876' +white = '#c5c9c5' +yellow = '#E6C384' + +[colors.selection] +background = '#2d4f67' +foreground = '#c8c093' + +[[colors.indexed_colors]] +index = 16 +color = '#ffa066' + +[[colors.indexed_colors]] +index = 17 +color = '#ff5d62' diff --git a/.config/alacritty/themes/kanagawa_wave.toml b/.config/alacritty/themes/kanagawa_wave.toml new file mode 100644 index 0000000..73ae8fb --- /dev/null +++ b/.config/alacritty/themes/kanagawa_wave.toml @@ -0,0 +1,38 @@ +# Colors (Kanagawa Wave) +# Source https//github.com/rebelot/kanagawa.nvim + +[colors.primary] +background = '#1f1f28' +foreground = '#dcd7ba' + +[colors.normal] +black = '#090618' +red = '#c34043' +green = '#76946a' +yellow = '#c0a36e' +blue = '#7e9cd8' +magenta = '#957fb8' +cyan = '#6a9589' +white = '#c8c093' + +[colors.bright] +black = '#727169' +red = '#e82424' +green = '#98bb6c' +yellow = '#e6c384' +blue = '#7fb4ca' +magenta = '#938aa9' +cyan = '#7aa89f' +white = '#dcd7ba' + +[colors.selection] +background = '#2d4f67' +foreground = '#c8c093' + +[[colors.indexed_colors]] +index = 16 +color = '#ffa066' + +[[colors.indexed_colors]] +index = 17 +color = '#ff5d62' diff --git a/.config/nvim/lua/tovi/plugins/colorscheme.lua b/.config/nvim/lua/tovi/plugins/colorscheme.lua index 9d44f1a..6e4e562 100644 --- a/.config/nvim/lua/tovi/plugins/colorscheme.lua +++ b/.config/nvim/lua/tovi/plugins/colorscheme.lua @@ -1,65 +1,102 @@ --- return { --- "catppuccin/nvim", --- name = "catppuccin", --- priority = 1000, --- config = function () --- require("catppuccin").setup({ --- flavour = "mocha", -- 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 = "", --- }, --- }, --- }) --- --- vim.cmd("colorscheme catppuccin") --- end --- } - return { - "ellisonleao/gruvbox.nvim", - priority = 1000 , - config = function () - require("gruvbox").setup() - vim.cmd("colorscheme gruvbox") - end, + { + "catppuccin/nvim", + enabled = false, + name = "catppuccin", + priority = 1000, + config = function () + require("catppuccin").setup({ + flavour = "mocha", -- 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 = "", + }, + }, + }) + + -- vim.cmd("colorscheme catppuccin") + end + }, + { + "ellisonleao/gruvbox.nvim", + enabled = false, + priority = 1000 , + config = function () + require("gruvbox").setup() + vim.cmd("colorscheme gruvbox") + end, + }, + { + "rebelot/kanagawa.nvim", + priority = 1000 , + config = function () + -- Default options: + require('kanagawa').setup({ + compile = false, -- enable compiling the colorscheme + undercurl = true, -- enable undercurls + commentStyle = { italic = true }, + functionStyle = {}, + keywordStyle = { italic = true}, + statementStyle = { bold = true }, + typeStyle = {}, + transparent = false, -- do not set background color + dimInactive = false, -- dim inactive window `:h hl-NormalNC` + terminalColors = true, -- define vim.g.terminal_color_{0,17} + colors = { -- add/modify theme and palette colors + palette = {}, + theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, + }, + overrides = function(colors) -- add/modify highlights + return {} + end, + theme = "wave", -- Load "wave" theme when 'background' option is not set + background = { -- map the value of 'background' option to a theme + dark = "wave", -- try "dragon" ! + light = "lotus" + }, + }) + + -- setup must be called before loading + vim.cmd("colorscheme kanagawa") + end + }, } diff --git a/.config/nvim/lua/tovi/plugins/lualine.lua b/.config/nvim/lua/tovi/plugins/lualine.lua index 6e990a9..b15d9d4 100644 --- a/.config/nvim/lua/tovi/plugins/lualine.lua +++ b/.config/nvim/lua/tovi/plugins/lualine.lua @@ -7,7 +7,7 @@ return { lualine.setup({ options = { - theme = 'gruvbox', + theme = 'kanagawa', component_separators = { left = '', right = '' }, section_separators = { left = '', right = '' }, }, diff --git a/.config/nvim/lua/tovi/plugins/tmux.lua b/.config/nvim/lua/tovi/plugins/tmux.lua index 0844590..2bc4e13 100644 --- a/.config/nvim/lua/tovi/plugins/tmux.lua +++ b/.config/nvim/lua/tovi/plugins/tmux.lua @@ -5,6 +5,11 @@ return { copy_sync = { enable = false }, + navigation = { + cycle_navigation = true, + enable_default_keybindings = true, + persist_zoom = true, + }, resize = { -- enables default keybindings (A-hjkl) for normal mode enable_default_keybindings = false, diff --git a/.tmux.conf b/.tmux.conf index 050ea9a..829d1f8 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -65,8 +65,14 @@ bind-key -r f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' -set -g @plugin 'egel/tmux-gruvbox' -set -g @tmux-gruvbox 'dark' # or 'light' +set -g @plugin 'Nybkox/tmux-kanagawa' + +set -g @kanagawa-show-powerline true + +set -g @kanagawa-theme 'wave' + +# set -g @plugin 'egel/tmux-gruvbox' +# set -g @tmux-gruvbox 'dark' # or 'light' # set -g @plugin 'catppuccin/tmux' # From 4a839dd82d94ba8f0e6fede96bdbad1fc9cb0274 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 6 Jun 2024 08:12:27 +0930 Subject: [PATCH 2/5] feat: add blade syntax highlighting --- .config/nvim/lua/tovi/core/autocmd.lua | 5 - .config/nvim/lua/tovi/plugins/linting.lua | 1 + .../nvim/lua/tovi/plugins/nvim-treesitter.lua | 103 +++--------------- .config/nvim/lua/tovi/plugins/vim-blade.lua | 3 + .zshrc | 2 +- 5 files changed, 20 insertions(+), 94 deletions(-) create mode 100644 .config/nvim/lua/tovi/plugins/vim-blade.lua diff --git a/.config/nvim/lua/tovi/core/autocmd.lua b/.config/nvim/lua/tovi/core/autocmd.lua index 2d6aabd..33acae5 100644 --- a/.config/nvim/lua/tovi/core/autocmd.lua +++ b/.config/nvim/lua/tovi/core/autocmd.lua @@ -54,11 +54,6 @@ local aucmd_dict = { vim.opt_local.syntax = 'dockerfile' end }, - - { - pattern = { '*.blade.php' }, - command = [[set syntax=html]], - }, }, VimLeave = { diff --git a/.config/nvim/lua/tovi/plugins/linting.lua b/.config/nvim/lua/tovi/plugins/linting.lua index 2b5e8fc..10bcc4c 100644 --- a/.config/nvim/lua/tovi/plugins/linting.lua +++ b/.config/nvim/lua/tovi/plugins/linting.lua @@ -64,6 +64,7 @@ return { golang = { "gospell", "golangci-lint" }, python = { "pylint" }, dockerfile = { "hadolint" }, + blade = { "phpcs" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { diff --git a/.config/nvim/lua/tovi/plugins/nvim-treesitter.lua b/.config/nvim/lua/tovi/plugins/nvim-treesitter.lua index 7eb4f94..ac40c75 100644 --- a/.config/nvim/lua/tovi/plugins/nvim-treesitter.lua +++ b/.config/nvim/lua/tovi/plugins/nvim-treesitter.lua @@ -5,7 +5,6 @@ return { build = ":TSUpdate", dependencies = { "windwp/nvim-ts-autotag", - "nvim-treesitter/nvim-treesitter-textobjects", }, config = function() -- import nvim-treesitter plugin @@ -41,6 +40,7 @@ return { "dockerfile", "gitignore", "php", + "blade", }, -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx context_commentstring = { @@ -49,97 +49,24 @@ return { }, -- auto install above language parsers auto_install = true, - - textobjects = { - select = { - enable = true, - - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - - ["af"] = "@function.outer", - ["if"] = "@function.inner", - - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - - ["ab"] = "@block.outer", - ["ib"] = "@block.inner", - - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - - ["am"] = "@call.outer", - ["im"] = "@call.inner", - - ["ai"] = "@conditional.outer", - ["ii"] = "@conditional.inner", - }, - selection_modes = { - ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise - ['@class.outer'] = '', -- blockwise - }, - include_surrounding_whitespace = true, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - goto_next = { - ["]i"] = "@conditional.outer", - ["]l"] = "@loop.outer", - }, - goto_previous = { - ["[i"] = "@conditional.outer", - ["[l"] = "@loop.outer", - } - }, - swap = { - enable = true, - swap_next = { - ["s"] = "@parameter.inner", - }, - swap_previous = { - ["S"] = "@parameter.inner", - }, - }, - }, }) - local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move") + local parser_config = require "nvim-treesitter.parsers".get_parser_configs() - local keymap = vim.keymap - - -- vim way: ; goes to the direction you were moving. - keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move) - keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite) + parser_config.blade = { + install_info = { + url = "https://github.com/EmranMR/tree-sitter-blade", + files = { "src/parser.c" }, + branch = "main", + }, + filetype = "blade" + } - -- Optionally, make builtin f, F, t, T also repeatable with ; and , - keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f) - keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F) - keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t) - keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T) + vim.filetype.add({ + pattern = { + ['.*%.blade%.php'] = 'blade', + } + }) end, }, } diff --git a/.config/nvim/lua/tovi/plugins/vim-blade.lua b/.config/nvim/lua/tovi/plugins/vim-blade.lua new file mode 100644 index 0000000..f1c92a4 --- /dev/null +++ b/.config/nvim/lua/tovi/plugins/vim-blade.lua @@ -0,0 +1,3 @@ +return { + 'jwalton512/vim-blade' +} diff --git a/.zshrc b/.zshrc index 5f3fb6d..8539c7d 100644 --- a/.zshrc +++ b/.zshrc @@ -68,7 +68,7 @@ HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history HISTSIZE=99999999 SAVEHIST=$HISTSIZE -export PATH="~/.local/bin/:$PATH" +export PATH="${HOME}/.local/bin/:${HOME}/.cargo/bin:$PATH" if [[ $(uname) == 'Darwin' ]]; then fi From ee50c69dad1d25f92f61ef52261a96dea68e4fed Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 6 Jun 2024 15:13:51 +0930 Subject: [PATCH 3/5] feat: remove cursor line option --- .config/nvim/lua/tovi/core/options.lua | 4 ---- .config/nvim/lua/tovi/plugins/retrospect.lua | 11 ----------- 2 files changed, 15 deletions(-) delete mode 100644 .config/nvim/lua/tovi/plugins/retrospect.lua diff --git a/.config/nvim/lua/tovi/core/options.lua b/.config/nvim/lua/tovi/core/options.lua index ee100ec..cd1cc7b 100644 --- a/.config/nvim/lua/tovi/core/options.lua +++ b/.config/nvim/lua/tovi/core/options.lua @@ -37,11 +37,7 @@ vim.opt.colorcolumn = "80" vim.opt.formatoptions = 'tqj' -vim.cmd[[let g:pdv_cfg_autoEndFunction = 0]] - vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.termguicolors = true - -vim.opt.cursorline = true diff --git a/.config/nvim/lua/tovi/plugins/retrospect.lua b/.config/nvim/lua/tovi/plugins/retrospect.lua deleted file mode 100644 index 1fb6be3..0000000 --- a/.config/nvim/lua/tovi/plugins/retrospect.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "mrquantumcodes/retrospect.nvim", - config = function () - local retrospect = require('retrospect') - retrospect.setup({ - saveKey = "\\", - loadKey = "", - style = "default", - }) - end -} From 7d0bb20af978dbfbd39582d843973955cc9a1e39 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 6 Jun 2024 15:24:18 +0930 Subject: [PATCH 4/5] feat: remove unused options --- .config/nvim/lua/tovi/core/autocmd.lua | 9 --------- .config/nvim/lua/tovi/core/remaps.lua | 20 +++----------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/.config/nvim/lua/tovi/core/autocmd.lua b/.config/nvim/lua/tovi/core/autocmd.lua index 33acae5..7613a79 100644 --- a/.config/nvim/lua/tovi/core/autocmd.lua +++ b/.config/nvim/lua/tovi/core/autocmd.lua @@ -55,15 +55,6 @@ local aucmd_dict = { end }, }, - - VimLeave = { - { - -- Save session on exit - callback = function() - require('retrospect').SaveSession() - end, - }, - }, } for event, opt_tbls in pairs(aucmd_dict) do diff --git a/.config/nvim/lua/tovi/core/remaps.lua b/.config/nvim/lua/tovi/core/remaps.lua index 023188c..f3625c3 100644 --- a/.config/nvim/lua/tovi/core/remaps.lua +++ b/.config/nvim/lua/tovi/core/remaps.lua @@ -9,11 +9,8 @@ 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" }) --- Copy the entire file -vim.keymap.set("n", "y", "ggyG", { desc = "Copy the entire file to default register" }) - -- Spell-check -vim.keymap.set("n", "o", "setlocal spell! spelllang=en_au", { desc = "Toggle spell check" }) +vim.keymap.set("n", "o", vim.cmd("setlocal spell! spelllang=en_au"), { desc = "Toggle spell check" }) -- Map Q to nop vim.keymap.set("n", "Q", "", { desc = "Remap Q to because Q is the worst" }) @@ -22,17 +19,6 @@ vim.keymap.set("n", "Q", "", { desc = "Remap Q to because Q is the wo vim.keymap.set("v", "<", "", ">gv", { desc = "Keep highlight when indenting" }) --- Easily navigate tabs --- vim.keymap.set("n", "", "1gt", { desc = "Navigate to tab 2" }) --- vim.keymap.set("n", "", "2gt", { desc = "Navigate to tab 3" }) --- vim.keymap.set("n", "", "3gt", { desc = "Navigate to tab 4" }) --- vim.keymap.set("n", "", "4gt", { desc = "Navigate to tab 5" }) --- vim.keymap.set("n", "", "5gt", { desc = "Navigate to tab 6" }) --- vim.keymap.set("n", "", "6gt", { desc = "Navigate to tab 7" }) --- vim.keymap.set("n", "", "7gt", { desc = "Navigate to tab 8" }) --- vim.keymap.set("n", "", "8gt", { desc = "Navigate to tab 9" }) --- vim.keymap.set("n", "", "9gt", { desc = "Navigate to tab 10" }) - vim.keymap.set("n", "tN", "tabnew", { desc = "New tab" }) vim.keymap.set("n", "tn", "tabnext", { desc = "Next tab" }) vim.keymap.set("n", "tp", "tabprevious", { desc = "Previous tab" }) @@ -57,8 +43,8 @@ vim.keymap.set("n", "j", "cnextzz", { desc = "Next item in quic vim.keymap.set( "n", "rr", - [[:%s/\<\>//gI]], + [[:%s/\<\>//gI]], { desc = "Search and replace for word under cursor" } ) -vim.keymap.set('t', '', "",{silent = true}) +vim.keymap.set('t', '', "", { silent = true }) From 9c675245ed91e646a13d85f6f1e8f5d5da996c6a Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Thu, 6 Jun 2024 15:51:34 +0930 Subject: [PATCH 5/5] feat: remove colorscheme from lazy.lua config --- .config/nvim/lua/tovi/lazy.lua | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.config/nvim/lua/tovi/lazy.lua b/.config/nvim/lua/tovi/lazy.lua index b655089..9280b3a 100644 --- a/.config/nvim/lua/tovi/lazy.lua +++ b/.config/nvim/lua/tovi/lazy.lua @@ -11,18 +11,17 @@ if not vim.loop.fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) -require("lazy").setup({ - { import = "tovi.plugins" }, - { import = "tovi.plugins.lsp" }, -}, { - install = { - colorscheme = { "nightfly" }, - }, - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, +require("lazy").setup( + { + { import = "tovi.plugins" }, + { import = "tovi.plugins.lsp" }, + }, + { + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false, + }, })