From 4d4e715cb1a331a1075a5d449bf8328b1c4386e9 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 27 Jul 2024 13:55:08 -0400 Subject: [PATCH] Switch from leap to flash.nvim and add biome to ALE config --- .config/fish/functions/define_aliases.fish | 1 + .config/fish/functions/ssh_agent_startup.fish | 2 +- .config/nvim/config.vim | 25 +++++++++-------- .config/nvim/init.lua | 27 +++++++++++++++---- sync | 2 +- 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.config/fish/functions/define_aliases.fish b/.config/fish/functions/define_aliases.fish index 51955bc..48dad9f 100644 --- a/.config/fish/functions/define_aliases.fish +++ b/.config/fish/functions/define_aliases.fish @@ -14,6 +14,7 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands' alias bb 'bun --bun' alias pn pnpm alias nv 'neovide --fork; and clear' + alias hx helix switch "$uname" case Linux diff --git a/.config/fish/functions/ssh_agent_startup.fish b/.config/fish/functions/ssh_agent_startup.fish index f95df36..9d4f8e9 100644 --- a/.config/fish/functions/ssh_agent_startup.fish +++ b/.config/fish/functions/ssh_agent_startup.fish @@ -1,5 +1,5 @@ function ssh_agent_startup -d 'Start ssh agent and set env vars' - if test -z "$SSH_AUTH_SOCK"; and test -z "$SSH_AGENT_PID" + if test -z "$SSH_AUTH_SOCK"; and test -z "$SSH_AGENT_PID"; and test -z "$SSH_CLIENT" eval (ssh-agent -c) >/dev/null 2>&1 end end diff --git a/.config/nvim/config.vim b/.config/nvim/config.vim index 27654e4..995e891 100644 --- a/.config/nvim/config.vim +++ b/.config/nvim/config.vim @@ -23,7 +23,6 @@ set termguicolors inoremap jj -let mapleader = ',' nnoremap f ALEFix nnoremap a ALEToggle nnoremap nn Neotree toggle show git_status @@ -61,10 +60,10 @@ let g:ale_completion_enabled = 0 let g:pencil#map#suspend_af = 'K' let g:ale_linters = { - \ 'javascript': ['eslint', 'stylelint'], - \ 'typescript': ['eslint', 'stylelint'], - \ 'javascriptreact': ['eslint', 'stylelint'], - \ 'typescriptreact': ['eslint', 'stylelint'], + \ 'javascript': ['eslint', 'stylelint', 'biome'], + \ 'typescript': ['eslint', 'stylelint', 'biome'], + \ 'javascriptreact': ['eslint', 'stylelint', 'biome'], + \ 'typescriptreact': ['eslint', 'stylelint', 'biome'], \ 'go': ['golint', 'go vet'], \ 'vue': ['eslint', 'stylelint'], \ 'make': ['checkmake'], @@ -86,17 +85,17 @@ let g:ale_linters = { let g:ale_fixers = { \ 'go': ['goimports', 'remove_trailing_lines', 'trim_whitespace'], \ 'graphql': ['prettier'], - \ 'javascript': ['prettier'], - \ 'typescript': ['prettier'], - \ 'javascriptreact': ['prettier'], - \ 'typescriptreact': ['prettier'], + \ 'javascript': ['prettier', 'biome'], + \ 'typescript': ['prettier', 'biome'], + \ 'javascriptreact': ['prettier', 'biome'], + \ 'typescriptreact': ['prettier', 'biome'], \ 'vue': ['prettier'], \ 'css': ['prettier'], - \ 'yaml': ['prettier'], - \ 'json': ['prettier'], + \ 'yaml': ['prettier', 'biome'], + \ 'json': ['prettier', 'biome'], \ 'dart': ['dartfmt'], - \ 'html': ['prettier'], - \ 'markdown': ['prettier'], + \ 'html': ['prettier', 'biome'], + \ 'markdown': ['prettier', 'biome'], \ 'make': ['remove_trailing_lines', 'trim_whitespace'], \ 'elixir': ['mix_format'], \ 'terraform': ['terraform'], diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3e2a293..dde1334 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -17,7 +17,7 @@ plug("nvim-tree/nvim-web-devicons") plug("ms-jpq/coq_nvim", { ["branch"] = "coq" }) plug("ms-jpq/coq.artifacts", { ["branch"] = "artifacts" }) plug("folke/noice.nvim") -plug("ggandor/leap.nvim") +plug("folke/flash.nvim") plug("folke/zen-mode.nvim") plug("folke/twilight.nvim") plug("neovim/nvim-lspconfig") @@ -67,13 +67,15 @@ require("lualine").setup({ require("zen-mode").setup({ window = { - backdrop = 1, + backdrop = 0.95, + }, + plugins = { + twilight = { enabled = false }, -- enable to start Twilight when zen mode opens }, }) require("symbols-outline").setup({ autofold_depth = 2, }) -require("leap").create_default_mappings() require("notify").setup({ background_colour = "#000000", @@ -111,6 +113,7 @@ require("nvim-treesitter.configs").setup({ "lua", "vim", "regex", + "bash", "fish", "typescript", "javascript", @@ -119,6 +122,8 @@ require("nvim-treesitter.configs").setup({ "elixir", "vue", "groovy", + "hcl", + "terraform", }, -- Automatically install missing parsers when entering buffer @@ -149,9 +154,21 @@ require("nvim-treesitter.configs").setup({ }, }) +-- Map Leader +vim.g.mapleader = "," + +-- Flash config +local flash = require("flash") +flash.setup() +vim.keymap.set({ "n", "x", "o" }, "s", flash.jump, { desc = "Flash" }) +vim.keymap.set({ "n", "x", "o" }, "S", flash.treesitter, { desc = "Flash Treesitter" }) +vim.keymap.set("o", "r", flash.remote, { desc = "Remote Flash" }) +vim.keymap.set({ "o", "x" }, "R", flash.treesitter_search, { desc = "Treesitter Search" }) +vim.keymap.set("c", "", flash.toggle, { desc = "Toggle Flash Search" }) + -- LSP Mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions -local opts = { noremap = true, silent = true } +local opts = { silent = true } vim.keymap.set("n", "d", vim.diagnostic.open_float, opts) vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) @@ -165,7 +182,7 @@ local on_attach = function(client, bufnr) -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions - local bufopts = { noremap = true, silent = true, buffer = bufnr } + local bufopts = { silent = true, buffer = bufnr } vim.keymap.set("n", "h", vim.lsp.buf.hover, bufopts) vim.keymap.set("n", "", vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) diff --git a/sync b/sync index d49ba8a..d6315eb 100755 --- a/sync +++ b/sync @@ -92,7 +92,7 @@ end function install_nvim_plugins command -q nvim and nvim +PlugUpgrade +PlugUpdate +UpdateRemotePlugins +qa - and nvim +COQdeps +q +bnext + and nvim +COQdeps +bnext +bdelete end function sync_git_config