From 217722523deae12d9dc760846c6649860fac940a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 10 Oct 2022 23:23:56 +0200 Subject: Replace hop with leap and flit --- fnl/config/flit.fnl | 9 +++++++++ fnl/config/hop.fnl | 40 ---------------------------------------- fnl/config/init.fnl | 3 ++- fnl/config/leap.fnl | 19 +++++++++++++++++++ fnl/plugins.fnl | 3 ++- 5 files changed, 32 insertions(+), 42 deletions(-) create mode 100644 fnl/config/flit.fnl delete mode 100644 fnl/config/hop.fnl create mode 100644 fnl/config/leap.fnl diff --git a/fnl/config/flit.fnl b/fnl/config/flit.fnl new file mode 100644 index 0000000..10e103d --- /dev/null +++ b/fnl/config/flit.fnl @@ -0,0 +1,9 @@ +;; fFtT motions on roids. +(module config.flit {autoload {: util nvim aniseed.nvim}}) + +(def- opts {:keys {:f :f :F :F :t :t :T :T} + :labeled_modes :v + :multiline true + :opts {}}) + +(util.use-config :flit opts) diff --git a/fnl/config/hop.fnl b/fnl/config/hop.fnl deleted file mode 100644 index 7bba398..0000000 --- a/fnl/config/hop.fnl +++ /dev/null @@ -1,40 +0,0 @@ -;; Hopping in text. -(module config.hop {autoload {: util nvim aniseed.nvim}}) - -(util.use-config :hop {}) - -(def- opts {:noremap true :silent true}) - -(nvim.set_keymap :n :ms ":HopChar2" {:silent true}) -(nvim.set_keymap :n :mS ":HopWord" {:silent true}) -(nvim.set_keymap :o :f - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })" - opts) - -(nvim.set_keymap :o :F - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })" - opts) - -(nvim.set_keymap :o :t - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })" - opts) - -(nvim.set_keymap :o :T - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })" - opts) - -(nvim.set_keymap :n :f - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true })" - opts) - -(nvim.set_keymap :n :F - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true })" - opts) - -(nvim.set_keymap :n :t - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })" - opts) - -(nvim.set_keymap :n :T - ":lua require'hop'.hint_char1({ direction = require'hop.hint'.HintDirection.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })" - opts) diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index b752361..46a3c3b 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -11,9 +11,10 @@ config.comment config.diffview config.fidget + config.flit config.gitsigns config.harpoon - config.hop + config.leap config.lir config.lsp config.lualine diff --git a/fnl/config/leap.fnl b/fnl/config/leap.fnl new file mode 100644 index 0000000..cb6a267 --- /dev/null +++ b/fnl/config/leap.fnl @@ -0,0 +1,19 @@ +;; Leap through text. +(module config.leap {autoload {: util nvim aniseed.nvim}}) + +(def- opts {:max_aot_targets nil + :highlight_unlabeled false + :max_highlighted_traversal_targets 10 + :case_sensitive false + :equivalence_classes [" \t\r\n"] + :substitute_chars [] + :special_keys {:repeat_search : + :next_aot_match : + :next_match [";" :] + :prev_match ["," :] + :next_group : + :prev_group :}}) + +(let [leap (util.load-plugin :leap)] + (leap.setup opts) + (leap.set_default_keymaps)) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 93c87f6..6b48bea 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -13,11 +13,12 @@ :numToStr/Comment.nvim {} :sindrets/diffview.nvim {} :j-hui/fidget.nvim {} + :ggandor/flit.nvim {} :rafamadriz/friendly-snippets {} :lewis6991/gitsigns.nvim {} :ThePrimeagen/harpoon {} - :phaazon/hop.nvim {} :lewis6991/impatient.nvim {} + :ggandor/leap.nvim {} :tamago324/lir.nvim {} :onsails/lspkind-nvim {} :nvim-lualine/lualine.nvim {:requires {1 :kyazdani42/nvim-web-devicons :opt true}} -- cgit v1.2.3-70-g09d2 From 48315bc5d678c46503e0d2be999d2ffe1049067a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 10 Oct 2022 23:24:08 +0200 Subject: Remove nvim-tree --- fnl/config/init.fnl | 1 - fnl/config/nvim-tree.fnl | 67 ------------------------------------------------ fnl/plugins.fnl | 1 - 3 files changed, 69 deletions(-) delete mode 100644 fnl/config/nvim-tree.fnl diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl index 46a3c3b..059a42b 100644 --- a/fnl/config/init.fnl +++ b/fnl/config/init.fnl @@ -20,7 +20,6 @@ config.lualine config.minibar config.neogit - config.nvim-tree config.orgmode config.project config.spectre diff --git a/fnl/config/nvim-tree.fnl b/fnl/config/nvim-tree.fnl deleted file mode 100644 index 097ae47..0000000 --- a/fnl/config/nvim-tree.fnl +++ /dev/null @@ -1,67 +0,0 @@ -;; A vertical sidebar file explorer. -(module config.nvim-tree {autoload {: util nvim aniseed.nvim}}) - -(let [nvim-tree (util.load-plugin :nvim-tree) - nvim-tree-config (util.load-plugin :nvim-tree.config)] - (let [tree-cb nvim-tree-config.nvim_tree_callback] - (nvim-tree.setup {:auto_reload_on_write true - :disable_netrw false - :hijack_cursor false - :hijack_netrw true - :filesystem_watchers {:enable true :debounce_delay 100} - :hijack_unnamed_buffer_when_opening false - :ignore_buffer_on_setup false - :open_on_setup false - :open_on_tab false - :sort_by :name - :update_cwd true - :view {:width 30 - :side :left - :preserve_window_proportions false - :number false - :hide_root_folder false - :relativenumber false - :signcolumn :yes - :mappings {:custom_only false - :list [{:key [:l : :o] - :cb (tree_cb :edit)} - {:key :h - :cb (tree_cb :close_node)} - {:key :v :cb (tree_cb :vsplit)}]}} - :renderer {:icons {:webdev_colors false}} - :hijack_directories {:enable false} - :update_focused_file {:enable true - :update_cwd true - :ignore_list {}} - :ignore_ft_on_setup [:startify :dashboard :alpha] - :system_open {:cmd nil :args {}} - :diagnostics {:enable true - :show_on_dirs false - :icons {:hint "" - :info "" - :warning "" - :error ""}} - :filters {:dotfiles false :custom {} :exclude {}} - :git {:enable true :ignore true :timeout 400} - :actions {:change_dir {:enable true :global false} - :open_file {:quit_on_open false - :resize_window false - :window_picker {:enable true - :chars :ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 - :exclude {:filetype [:notify - :packer - :qf - :diff - :fugitive - :fugitiveblame] - :buftype [:nofile - :terminal - :help]}}}} - :trash {:cmd :trash :require_confirm true} - :log {:enable false - :truncate false - :types {:all false - :config false - :copy_paste false - :git false - :profile false}}}))) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 6b48bea..2b29d80 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -38,7 +38,6 @@ :neovim/nvim-lspconfig {} :windwp/nvim-spectre {} :kylechui/nvim-surround {} - :kyazdani42/nvim-tree.lua {:requires [:kyazdani42/nvim-web-devicons]} :nvim-treesitter/nvim-treesitter {:run ":TSUpdate"} :JoosepAlviste/nvim-ts-context-commentstring {} :kyazdani42/nvim-web-devicons {} -- cgit v1.2.3-70-g09d2 From a70bbd714f4967d6a5b81a163dbed8bac1157696 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 10 Oct 2022 23:31:38 +0200 Subject: Remove insane refresh on lualine --- fnl/config/lualine.fnl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 7701915..472f494 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -58,8 +58,7 @@ :disabled_filetypes disable :ignore_focus ignore :always_divide_middle true - :globalstatus true - :refresh {:statusline 50}} + :globalstatus true} :sections {:lualine_a [:mode] :lualine_b [branch diff] :lualine_c {} -- cgit v1.2.3-70-g09d2 From a688a66c4f9cbf1f88052eb32e476d53e158773b Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 10 Oct 2022 23:31:56 +0200 Subject: Remove nvim-tree command in which-key --- fnl/config/which-key.fnl | 1 - 1 file changed, 1 deletion(-) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 1d196fa..48a39be 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -137,7 +137,6 @@ (def- nmappings {:a ["Telescope lsp_document_symbols" "Document Symbols"] :c [:Bdelete! "Close Buffer"] - :e [:NvimTreeToggle :Explorer] :f find :g git :h [:Alpha :Alpha] -- cgit v1.2.3-70-g09d2 From 1eff49e1fb24630eb61f6ba0cf90702f90f2f73d Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 11 Oct 2022 00:17:20 +0200 Subject: Refactor synchronized --- fnl/util.fnl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fnl/util.fnl b/fnl/util.fnl index a80f0eb..88ec1c3 100644 --- a/fnl/util.fnl +++ b/fnl/util.fnl @@ -18,9 +18,7 @@ (defn- deep-equal [xs ys] (and (contains xs ys) (contains ys xs))) -(defn- synchronized [configured installed] - (and (= (vim.tbl_count configured) (vim.tbl_count installed)) - (deep-equal configured installed))) +(defn- synchronized [configured installed] (deep-equal configured installed)) (defn- install [] (packer.startup (fn [use] -- cgit v1.2.3-70-g09d2 From edef92a943e237ca483b43f912cf844653fc49b7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 11 Oct 2022 00:24:07 +0200 Subject: Remove more nvim-tree config --- fnl/config/autocmd.fnl | 3 --- fnl/config/lualine.fnl | 2 +- fnl/config/minibar.fnl | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fnl/config/autocmd.fnl b/fnl/config/autocmd.fnl index 40eb338..017792f 100644 --- a/fnl/config/autocmd.fnl +++ b/fnl/config/autocmd.fnl @@ -3,9 +3,6 @@ (defn create-autocmd [event opts] (nvim.create_autocmd event opts)) -(create-autocmd :BufEnter - {:command "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif"}) - (create-autocmd :FileType {:pattern [:qf :help :man :lspinfo] :command "nnoremap q :close"}) diff --git a/fnl/config/lualine.fnl b/fnl/config/lualine.fnl index 472f494..d098966 100644 --- a/fnl/config/lualine.fnl +++ b/fnl/config/lualine.fnl @@ -8,7 +8,7 @@ :NeogitStatus :NeogitCommitMessage]) -(def- ignore [:help :NvimTree :packer :spectre_panel :TelescopePrompt]) +(def- ignore [:help :packer :spectre_panel :TelescopePrompt]) (defn- active-clients [] (let [clients (vim.lsp.buf_get_clients) client_names []] diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl index f8c0a30..fddb71c 100644 --- a/fnl/config/minibar.fnl +++ b/fnl/config/minibar.fnl @@ -6,7 +6,6 @@ :dashboard :packer :neogitstatus - :NvimTree :Trouble :alpha :lir -- cgit v1.2.3-70-g09d2 From 34d5c56462ddf6aef4c754ba39e650fe540c67c3 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 11 Oct 2022 00:25:05 +0200 Subject: Remap neogit to mmappings --- fnl/config/which-key.fnl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 48a39be..8e89095 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -50,9 +50,10 @@ "Harpoon Prev"] :t ["Telescope harpoon marks" "Search Files"] :v ["lua vim.lsp.buf.rename()" :Rename] - :p ["SaveSession" "Save Session"] + :p [:SaveSession "Save Session"] :r ["lua require('harpoon.ui').toggle_quick_menu()" - "Harpoon UI"]}) + "Harpoon UI"] + :n [:Neogit :Neogit]}) (def- nopts {:mode :n :prefix : @@ -78,8 +79,8 @@ :C ["Telescope commands" :Commands]}) (def- git {:name :Git - :d ["DiffviewOpen" "Diffview"] - :D ["DiffviewFileHistory" "DiffviewFileHistory"] + :d ["Gitsigns diffthis HEAD" :Diff] + :D [:DiffviewFileHistory :DiffviewFileHistory] :j ["lua require 'gitsigns'.next_hunk()" "Next Hunk"] :k ["lua require 'gitsigns'.prev_hunk()" "Prev Hunk"] :l ["lua require 'gitsigns'.blame_line()" :Blame] @@ -92,8 +93,7 @@ :o ["Telescope git_status" "Open changed file"] :b ["Telescope git_branches" "Checkout branch"] :c ["Telescope git_commits" "Checkout commit"] - :d ["Gitsigns diffthis HEAD" :Diff] - :n [:Neogit :Neogit]}) + :d ["Gitsigns diffthis HEAD" :Diff]}) (def- lsp {:name :LSP :a ["lua vim.lsp.buf.code_action()" "Code Action"] -- cgit v1.2.3-70-g09d2 From 5587e29a877832fae52e67c99d8dd142d505bb45 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 11 Oct 2022 00:27:23 +0200 Subject: Update neovim version --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a75238..a8d6395 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ My neovim config written in fennel. # Dependencies ``` -neovim >= 0.8 +neovim = nightly ``` # Sync -Sync plugins: +Sync plugins (experimental): `./sync.sh` -- cgit v1.2.3-70-g09d2 From 69483c9b53e8d14e7c4398380ac64b2ea8c27887 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 11 Oct 2022 00:42:44 +0200 Subject: Add dropdown theme on most telescope commands --- fnl/config/which-key.fnl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl index 8e89095..148ee29 100644 --- a/fnl/config/which-key.fnl +++ b/fnl/config/which-key.fnl @@ -40,7 +40,7 @@ :b ["lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{sort_lastused = true, initial_mode = 'normal', previewer = false})" "Switch buffers"] :d [:TroubleToggle :Trouble] - :D ["Telescope diagnostics" "Telescope diagnostics"] + :D ["Telescope diagnostics theme=dropdown" "Telescope diagnostics"] :f ["lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})" "Find files"] :g ["Telescope live_grep theme=ivy" "Find text"] @@ -48,7 +48,7 @@ "Harpoon Next"] :h ["lua require('harpoon.ui').nav_prev()" "Harpoon Prev"] - :t ["Telescope harpoon marks" "Search Files"] + :t ["Telescope harpoon marks theme=dropdown" "Search Files"] :v ["lua vim.lsp.buf.rename()" :Rename] :p [:SaveSession "Save Session"] :r ["lua require('harpoon.ui').toggle_quick_menu()" @@ -63,17 +63,17 @@ :nowait true}) (def- find {:name :Find - :b ["Telescope git_branches" "Checkout branch"] - :c ["Telescope colorscheme" :Colorscheme] + :b ["Telescope git_branches theme=dropdown" "Checkout branch"] + :c ["Telescope colorscheme theme=dropdown" :Colorscheme] :f ["lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})" "Find files"] :t ["Telescope live_grep theme=ivy" "Find text"] - :s ["Telescope grep_string" "Find String"] + :s ["Telescope grep_string theme=dropdown" "Find String"] :h ["Telescope help_tags" :Help] :H ["Telescope highlights" :Highlights] :l ["Telescope resume" "Last Search"] :M ["Telescope man_pages" "Man Pages"] - :r ["Telescope oldfiles" "Recent File"] + :r ["Telescope oldfiles theme=dropdown" "Recent File"] :R ["Telescope registers" :Registers] :k ["Telescope keymaps" :Keymaps] :C ["Telescope commands" :Commands]}) @@ -90,9 +90,9 @@ :s ["lua require 'gitsigns'.stage_hunk()" "Stage Hunk"] :u ["lua require 'gitsigns'.undo_stage_hunk()" "Undo Stage Hunk"] - :o ["Telescope git_status" "Open changed file"] - :b ["Telescope git_branches" "Checkout branch"] - :c ["Telescope git_commits" "Checkout commit"] + :o ["Telescope git_status theme=dropdown" "Open changed file"] + :b ["Telescope git_branches theme=dropdown" "Checkout branch"] + :c ["Telescope git_commits theme=dropdown" "Checkout commit"] :d ["Gitsigns diffthis HEAD" :Diff]}) (def- lsp {:name :LSP @@ -134,7 +134,7 @@ (if (not= win nil) (nvim.set_current_win win))))) -(def- nmappings {:a ["Telescope lsp_document_symbols" +(def- nmappings {:a ["Telescope lsp_document_symbols theme=dropdown" "Document Symbols"] :c [:Bdelete! "Close Buffer"] :f find -- cgit v1.2.3-70-g09d2