cleanup vim

This commit is contained in:
Leon Kowarschick 2023-10-06 18:26:06 +02:00
parent 312a1809bd
commit d446425f25
Signed by: ElKowar
GPG key ID: 72C759DA738DE3A2
30 changed files with 266 additions and 588 deletions

View file

@ -1,68 +0,0 @@
(fn help-thingy-kram []
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local a (autoload :aniseed.core))
(local str (autoload :aniseed.string))
(local popup (autoload :popup))
(local ts (autoload :nvim-treesitter))
(defn pop [text ft]
"Open a popup with the given text and filetype"
(var width 20)
(each [_ line (ipairs text)]
(set width (math.max width (length line))))
(let [bufnr (vim.api.nvim_create_buf false true)]
(vim.api.nvim_buf_set_option bufnr :bufhidden "wipe")
(vim.api.nvim_buf_set_option bufnr :filetype ft)
(vim.api.nvim_buf_set_lines bufnr 0 -1 true text)
(popup.create bufnr {:padding [1 1 1 1] :width width})))
(defn get-current-word []
"Return the word the cursor is currently hovering over"
(let [col (. (vim.api.nvim_win_get_cursor 0) 2)
line (vim.api.nvim_get_current_line)]
(.. (vim.fn.matchstr (line:sub 1 (+ col 1)) "\\k*$")
(string.sub (vim.fn.matchstr (line:sub (+ col 1)) "^\\k*")
2))))
(def helpfiles-path (str.join "/" (a.butlast (str.split vim.o.helpfile "/"))))
(def tags
(var entries {})
(each [line _ (io.lines (.. helpfiles-path "/tags"))]
(let [[key file address] (str.split line "\t")]
(tset entries key {:file (.. helpfiles-path "/" file) :address address})))
entries)
(defn find-help-tag-for [topic]
(or (. tags topic)
(. tags (.. topic "()"))
(. tags (.. (string.gsub topic "vim%.api%." "") "()"))
(. tags (.. (string.gsub topic "vim%.fn%." "") "()"))
(. tags (.. (string.gsub topic "fn%." "") "()"))
(. tags (.. (string.gsub topic "vim%.o%." "") "()"))
(. tags (.. (string.gsub topic "vim%.b%." "") "()"))
(. tags (.. (string.gsub topic "vim%.g%." "") "()"))))
(defn help-for-tag [tag]
(var data nil)
(each [line _ (io.lines tag.file)]
(if (= nil data)
(when (~= -1 (vim.fn.match line (tag.address:sub 2)))
(set data [line]))
(if (or (> 2 (length data))
(= "" line)
(= " " (line:sub 1 1))
(= "\t" (line:sub 1 1))
(= "<" (line:sub 1 1)))
(table.insert data line)
(lua "return data")))))
(fn _G.get_help []
(if-let [help-tag (find-help-tag-for (get-current-word))]
(pop (help-for-tag help-tag) :help)))
(utils.keymap :n :ML ":call v:lua.get_help()<CR>"))
[]

View file

@ -1,17 +1,18 @@
(import-macros {: al} :macros)
(al a nfnl.core)
(al str nfnl.string)
(al utils dots.utils)
(al wk which-key)
; (al treesitter-selection nvim-treesitter.incremental_selection)
(al lspactions lspactions)
(al glance glance)
(al crates crates)
(local {: autoload} (require :nfnl.module))
(local a (autoload :nfnl.core))
(local str (autoload :nfnl.string))
(local utils (autoload :dots.utils))
(local wk (autoload :which-key))
(local glance (autoload :glance))
(local crates (autoload :crates))
(local dap (autoload :dap))
(local dapui (autoload :dapui))
; undo autopairs fuckup
(set vim.g.AutoPairsShortcutBackInsert "<M-b>")
(utils.keymap [:n] :<C-p> "<cmd>Telescope file_browser<cr>")
(utils.keymap :n :K "<Nop>")
(utils.keymap :v :K "<Nop>")
@ -19,9 +20,6 @@
(utils.keymap :i :<C-h> "<C-w>")
(utils.keymap :i :<C-BS> "<C-w>")
(utils.keymap :n :MM "<cmd>lua require('nvim-gehzu').go_to_definition()<CR>" {})
(utils.keymap :n :MN "<cmd>lua require('nvim-gehzu').show_definition()<CR>" {})
(utils.keymap :n :zt "zt<c-y><c-y><c-y>")
(utils.keymap :n :zb "zb<c-e><c-e><c-e>")
@ -32,7 +30,6 @@
(utils.keymap :n :<C-LeftMouse> "<LeftMouse><cmd>lua vim.lsp.buf.definition()<CR>")
(utils.keymap :n :<A-LeftMouse> "<Esc><LeftMouse><cmd>lua vim.lsp.buf.hover()<CR>")
(utils.keymap :n :<Backspace> "<cmd>HopChar2<CR>")
;(utils.keymap :i :<C-l><C-j> "<Plug>(copilot-suggest)")
;(utils.keymap :i :<C-l><C-d> "<Plug>(copilot-dismiss)")
@ -44,6 +41,7 @@
(utils.keymap :n :<a-s-k> "<cmd>RustMoveItemUp<cr>k")
(utils.keymap :n :<Backspace> "<cmd>HopChar2<CR>")
; Fix keybinds in linewrapped mode
@ -69,21 +67,19 @@
(vim.api.nvim_feedkeys (.. ":IncRename " (vim.fn.expand "<cword>")) "n" ""))
(fn toggle-lsp-lines []
(let [lsp-lines (require "lsp_lines")]
(vim.diagnostic.config {:virtual_lines (not (. (vim.diagnostic.config) :virtual_lines))})
; TODO: this doesn't seem to work...
(vim.diagnostic.config {:virtual_text (not (. (vim.diagnostic.config) :virtual_lines))})))
(vim.diagnostic.config {:virtual_text (not (. (vim.diagnostic.config) :virtual_lines))}))
(fn toggle-lsp-lines-current []
(let [lsp-lines (require "lsp_lines")]
(vim.diagnostic.config {:virtual_lines {:only_current_line true}})))
(vim.diagnostic.config {:virtual_lines {:only_current_line true}}))
(wk.setup {})
(wk.register
{"c" {:name "+comment out"}
"e" {:name "+emmet"}
"<backspace>" (cmd "HopWord" "Hop to a word")
"[" (cmd "HopWord" "Hop to a word")
"h" (cmd "bprevious" "previous buffer")
"l" (cmd "bnext" "next buffer")
"o" (cmd "Telescope live_grep" "Grep files")
@ -96,14 +92,14 @@
"n" [(. (require :persistence) :load) "Load last session"]
"d" {:name "+Debugging"
"b" [#(req dap.toggle_breakpoint) "toggle breakpoint"]
"u" [#(req dapui.toggle) "toggle dapui"]
"c" [#(req dap.step_into) "continue"]
"r" [(. (require "dap") :repl :open) "open repl"]
"b" [dap.toggle_breakpoint "toggle breakpoint"]
"u" [dapui.toggle "toggle dapui"]
"c" [dap.step_into "continue"]
"r" [dap.repl.open "open repl"]
"s" {:name "+Step"
"o" [#(req dap.step_over) "over"]
"u" [#(req dap.step_out) "out"]
"i" [#(req dap.step_into) "into"]}}
"o" [dap.step_over "over"]
"u" [dap.step_out "out"]
"i" [dap.step_into "into"]}}
"m" {:name "+Code actions"
";" [#(set vim.o.spell (not vim.o.spell)) "Toggle spell checking"]
@ -154,7 +150,7 @@
"w" (cmd "set wrap! linebreak!" "toggle linewrapping")}
"b" {:name "+buffers"
"b" (cmd "Buffers" "select open buffer")
"b" (cmd ":Telescope buffers" "select open buffer")
"c" (cmd ":Bdelete!" "close open buffer")
"w" (cmd ":Bwipeout!" "wipeout open buffer")}}

View file

@ -61,6 +61,8 @@
:error_diagnostic_selected (mk-active colors.red)
:separator visible
:separator_visible {:bg colors.red}
:separator_selected {:bg colors.red}
:indicator_selected {:bg colors.neutral_aqua :fg colors.neutral_aqua :italic false :bold false}
:tab_separator {:bg colors.red}
:tab_separator_selected {:bg colors.neutral_aqua :fg colors.neutral_aqua}

View file

@ -1,20 +1,17 @@
(import-macros {: al} :macros)
(al a nfnl.core)
(al cmp cmp)
(al utils dots.utils)
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local cmp (autoload :cmp))
(fn setup []
; check this for coloring maybe
; https://github.com/hrsh7th/nvim-cmp/blob/ada9ddeff71e82ad0e52c9a280a1e315a8810b9a/lua/cmp/entry.lua#L199
(fn item-formatter [item vim-item]
; check this for coloring maybe
; https://github.com/hrsh7th/nvim-cmp/blob/ada9ddeff71e82ad0e52c9a280a1e315a8810b9a/lua/cmp/entry.lua#L199
(fn item-formatter [item vim-item]
(let [padding (string.rep " " (- 10 (vim.fn.strwidth vim-item.abbr)))
details (?. item :completion_item :detail)]
(when details
(set vim-item.abbr (.. vim-item.abbr padding " " details))))
vim-item)
(fn setup []
(cmp.setup
{:snippet {:expand (fn [args] ((. vim.fn :vsnip#anonymous) args.body))}

View file

@ -1,18 +1,12 @@
(import-macros {: al} :macros)
(al copilot copilot)
(al utils dots.utils)
(local utils (require :dots.utils))
(fn setup []
(copilot.setup
{:panel {:enabled false}
;:github/copilot.vim {:cmd ["Copilot"]}
[(utils.plugin
:zbirenbaum/copilot.lua
{:cmd "Copilot"
:event "InsertEnter"
:opts {:panel {:enabled false}
:suggestion {:enabled true
:auto_trigger :true
:keymap {:accept "<tab>"
:next "<C-l><C-n>"}}}))
;:github/copilot.vim {:cmd ["Copilot"]}
;[(utils.plugin :zbirenbaum/copilot.lua
; {:cmd "Copilot"
; :event "InsertEnter"
; :config setup}}))
[]
:next "<C-l><C-n>"}}}})]

View file

@ -1,18 +0,0 @@
(import-macros {: al} :macros)
(al utils dots.utils)
(al crates crates)
(fn setup []
(crates.setup {:disable_invalid_feature_diagnostic true
:enable_update_available_warning false}))
[(utils.plugin :Saecki/crates.nvim
{:dependencies ["nvim-lua/plenary.nvim"]
:dir "/Users/leon/tmp/crates.nvim"
:event ["BufRead Cargo.toml"]
:lazy true
:config setup})]

View file

@ -1,18 +1,15 @@
(import-macros m :macros)
(m.al diffview diffview)
(m.al cb diffview.config)
(m.al utils dots.utils)
(local {: autoload} (require :nfnl.module))
(local utils (require :dots.utils))
(local cb (autoload :diffview.config))
(local diffview (autoload :diffview))
(fn setup []
(diffview.setup
[(utils.plugin
:sindrets/diffview.nvim
{:cmd ["DiffviewOpen" "DiffviewToggleFiles"]
:config #(diffview.setup
{:diff_binaries false
:file_panel {:width 35
:use_icons false}
:key_bindings {:view {:<leader>dn (cb.diffview_callback "select_next_entry")
:<leader>dp (cb.diffview_callback "select_prev_entry")
:<leader>dd (cb.diffview_callback "toggle_files")}}}))
[(utils.plugin
:sindrets/diffview.nvim
{:cmd ["DiffviewOpen" "DiffviewToggleFiles"]
:config #setup})]
:<leader>dd (cb.diffview_callback "toggle_files")}}})})]

View file

@ -1,5 +1,4 @@
(import-macros m :macros)
(m.al utils dots.utils)
(local utils (require :dots.utils))
(fn setup []
(set vim.g.user_emmet_mode "n")

View file

@ -1,16 +1,15 @@
(import-macros m :macros)
(m.al a nfnl.core)
(m.al utils dots.utils)
(m.al str nfnl.string)
(m.al colors dots.colors)
(m.al feline feline)
(m.al feline-git feline.providers.git)
(m.al feline-lsp feline.providers.lsp)
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local a (autoload :nfnl.core))
(local str (autoload :nfnl.string))
(local colors (autoload :dots.colors))
(local feline (autoload :feline))
(fn setup [])
(set vim.opt.termguicolors true)
(local modes
(fn setup []
(set vim.opt.termguicolors true)
(local modes
{:n {:text "NORMAL" :color colors.neutral_aqua}
:i {:text "INSERT" :color colors.neutral_yellow}
:c {:text "CMMAND" :color colors.neutral_aqua}
@ -29,31 +28,31 @@
:V {:text "VISUAL LINE" :color colors.neutral_blue}
"" {:text "VISUAL BLOCK" :color colors.neutral_blue}})
(local bar-bg colors.bg_main)
(local horiz-separator-color colors.light1)
(local bar-bg colors.bg_main)
(local horiz-separator-color colors.light1)
(fn or-empty [x] (or x ""))
(fn spaces [x] (if x (.. " " x " ") ""))
(fn or-empty [x] (or x ""))
(fn spaces [x] (if x (.. " " x " ") ""))
(fn get-current-filepath []
(fn get-current-filepath []
(let [file (utils.shorten-path (vim.fn.bufname) 30 30)]
(if (a.empty? file) ""
vim.bo.readonly (.. "RO " file)
(and vim.bo.modifiable vim.bo.modified) (.. file " ●")
(.. file " "))))
(fn vim-mode-hl [use-as-fg?]
(fn vim-mode-hl [use-as-fg?]
(let [color (. modes (vim.fn.mode) :color)]
(if use-as-fg? {:bg bar-bg :fg color} {:bg color :fg bar-bg})))
(fn git-status-provider []
(fn git-status-provider []
(or-empty (utils.keep-if #(~= "master" $1)
(?. vim.b :gitsigns_status_dict :head))))
(fn vim-mode []
(fn vim-mode []
(.. " " (or (. modes (vim.fn.mode) :text) vim.fn.mode) " "))
(fn lsp-progress-provider []
(fn lsp-progress-provider []
(let [msgs (vim.lsp.util.get_progress_messages)
s (icollect [_ msg (ipairs msgs)]
(when msg.message
@ -62,38 +61,38 @@
(fn lsp-diagnostic-component [kind color]
(fn lsp-diagnostic-component [kind color]
{:enabled #(~= 0 (length (vim.diagnostic.get 0 {:severity kind})))
:provider #(spaces (length (vim.diagnostic.get 0 {:severity kind})))
:left_sep ""
:right_sep ""
:hl {:fg bar-bg :bg color}})
(fn coordinates []
(fn coordinates []
(let [[line col] (vim.api.nvim_win_get_cursor 0)]
(.. " " line " ")))
(.. " " line ":" col " ")))
; Fills the bar with an horizontal line
(fn inactive-separator-provider []
(fn inactive-separator-provider []
(if (not= (vim.fn.winnr) (vim.fn.winnr :j))
(string.rep "─" (vim.api.nvim_win_get_width 0))
""))
(local components {:active {} :inactive {}})
(local components {:active {} :inactive {}})
(tset components.active 1
(tset components.active 1
[{:provider vim-mode :hl #(vim-mode-hl false)}
{:provider get-current-filepath :left_sep " " :hl {:fg colors.light4}}
{:provider git-status-provider :left_sep " " :hl #(vim-mode-hl true)}])
(tset components.active 2
(tset components.active 2
[{:provider lsp-progress-provider
:left_sep " "
:right_sep " "
:enabled #(< 0 (length (vim.lsp.buf_get_clients)))}])
(tset components.active 3
(tset components.active 3
[{:provider vim.bo.filetype :right_sep " " :hl #(vim-mode-hl true)}
(lsp-diagnostic-component vim.diagnostic.severity.INFO colors.neutral_green)
(lsp-diagnostic-component vim.diagnostic.severity.HINT colors.neutral_aqua)
@ -101,15 +100,13 @@
(lsp-diagnostic-component vim.diagnostic.severity.ERROR colors.neutral_red)
{:provider coordinates :hl #(vim-mode-hl false)}])
(tset components.inactive 1
(tset components.inactive 1
[{:provider inactive-separator-provider
:hl {:bg "NONE" :fg horiz-separator-color}}])
(utils.highlight-add :StatusLineNC {:bg "NONE" :fg colors.light1})
(utils.highlight-add :StatusLineNC {:bg "NONE" :fg colors.light1})
(feline.setup {:theme {:fg colors.light1 :bg colors.bg_main}
:components components})
(feline.setup {:theme {:fg colors.light1 :bg colors.bg_main}
:components components}))
[(utils.plugin :Famiu/feline.nvim {:config setup})]

View file

@ -1,7 +1,6 @@
(import-macros m :macros)
(m.al utils dots.utils)
(m.al colors dots.colors)
(m.al gitsigns gitsigns)
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local gitsigns (autoload :gitsigns))
(fn setup []
(gitsigns.setup

View file

@ -1,8 +0,0 @@
(import-macros m :macros)
(m.al a aniseed.core)
(m.al glance glance)
(m.al utils dots.utils)
[(utils.plugin
:dnlhc/glance.nvim
{:lazy true :config #(glance.setup)})]

View file

@ -1,6 +1,6 @@
(import-macros {: al} :macros)
(al utils dots.utils)
(al colors dots.colors)
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local colors (autoload :dots.colors))
(fn setup []

View file

@ -18,15 +18,6 @@
(fn on_attach [client bufnr]
;(pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")]
;(lsp_signature.on_attach {:bind true
;:hint_scheme "String"
;:hint_prefix "ƒ "
;:handler_opts {:border "single"}
;:use_lspsaga false
;:decorator ["`" "`"]}))
;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"})
(if client.server_capabilities.documentHighlight
(do
(utils.highlight "LspReferenceRead" {:gui "underline"})

View file

@ -1,11 +1,8 @@
(import-macros m :macros)
(m.al a aniseed.core)
(m.al str aniseed.string)
(m.al lsp lspconfig)
(m.al configs lspconfig/configs)
(m.al lsputil lspconfig/util)
(m.al utils dots.utils)
(m.al cmp_nvim_lsp cmp_nvim_lsp)
(local {: autoload} (require :nfnl.module))
(local lsp (autoload :lspconfig))
(local configs (autoload :lspconfig/configs))
(local lsputil (autoload :lspconfig/util))
(local utils (require :dots.utils))
(fn cmds [xs]

View file

@ -1,9 +0,0 @@
(import-macros m :macros)
(m.al neogit neogit)
(m.al utils dots.utils)
[(utils.plugin :TimUntersberger/neogit
{:config #(neogit.setup {:integrations {:diffview true}})
:cmd ["Neogit"]})]

View file

@ -1,13 +1,8 @@
(import-macros m :macros)
(m.al utils dots.utils)
(fn setup []
(m.al a nfnl.core)
(m.al lazy lazy)
(m.al noice noice)
(m.al colors dots.colors)
(noice.setup
{:presets {:inc_rename true
(local utils (require :dots.utils))
[(utils.plugin
:folke/noice.nvim
{:dependencies [:MunifTanjim/nui.nvim]
:opts {:presets {:inc_rename true
:long_message_to_split true
:bottom_search true}
;:command_palette true}
@ -35,9 +30,6 @@
{:view "mini"
:filter {:error true :max_height 5}}
{:view "cmdline_output"
:filter {:error true :min_height 6}}]}))
:filter {:error true :min_height 6}}]}})]
;[(utils.plugin :folke/noice.nvim
; {:config setup
; :dependencies [:MunifTanjim/nui.nvim]}}]}))
[]

View file

@ -1,7 +1,6 @@
(import-macros m :macros)
(m.al colorizer colorizer)
(m.al utils dots.utils)
(local {: autoload} (require :nfnl.module))
(local colorizer (autoload :colorizer))
(local utils (autoload :dots.utils))
(fn setup []
; this really shouldn't be necessary,.. but it is

View file

@ -1,11 +0,0 @@
(import-macros m :macros)
(m.al persistence persistence)
(m.al utils dots.utils)
(fn setup []
(persistence.setup
{:dir (vim.fn.expand (.. (vim.fn.stdpath "cache") "/sessions/"))}))
[(utils.plugin :folke/persistence.nvim
{:config setup})]

View file

@ -1,6 +1,4 @@
(import-macros {: al} :macros)
(al a nfnl.core)
(al lazy lazy)
;(local {: autolod} (require :nfnl.module))
(macro setup [name opts]
@ -22,20 +20,19 @@
(plugin :psliwka/vim-smoothie)
(plugin :nathanaelkane/vim-indent-guides
{:cmd ["IndentGuidesToggle"]})
(plugin :luukvbaal/stabilize.nvim
{:config #(setup :stabilize)})
(plugin :stevearc/dressing.nvim
{:config #(setup :dressing)})
(plugin :tweekmonster/startuptime.vim
{:cmd ["StartupTime"]})
(plugin :moll/vim-bbye
{:lazy true :cmd [:Bdelete :Bwipeout]})
(plugin :luukvbaal/stabilize.nvim {:config true})
(plugin :stevearc/dressing.nvim {:config true})
(plugin :tweekmonster/startuptime.vim {:cmd ["StartupTime"]})
(plugin :moll/vim-bbye {:lazy true :cmd [:Bdelete :Bwipeout]})
(plugin :petertriho/nvim-scrollbar
{:event "VeryLazy"
:lazy true
:config #(setup :scrollbar)})
:config true})
(plugin :TimUntersberger/neogit
{:opts {:integrations {:diffview true}}
:cmd ["Neogit"]})
(plugin :folke/persistence.nvim
{:opts {:dir (vim.fn.expand (.. (vim.fn.stdpath "cache") "/sessions/"))}})
(plugin "https://git.sr.ht/~whynothugo/lsp_lines.nvim"
{:config #(do (setup :lsp_lines)
@ -59,13 +56,13 @@
(plugin :phaazon/hop.nvim
{:lazy true
:event "VeryLazy"
:config #(setup "hop" {:keys "jfkdls;amvieurow"})})
:opts {:keys "jfkdls;amvieurow"}})
; >>>
; debugger <<<
(plugin :rcarriga/nvim-dap-ui
{:lazy true
:config #(setup :dapui)
:config true
:dependencies [:mfussenegger/nvim-dap]})
(plugin :mfussenegger/nvim-dap
{:lazy true})
@ -87,7 +84,7 @@
:dependencies [:nvim-lua/plenary.nvim
:nvim-telescope/telescope.nvim
:kyazdani42/nvim-web-devicons]
:config #(setup :octo)})
:config true})
(plugin :ruanyl/vim-gh-line)
(plugin :rhysd/conflict-marker.vim)
@ -101,9 +98,11 @@
(plugin :weilbith/nvim-code-action-menu
{:cmd "CodeActionMenu"
:config #(set vim.g.code_action_menu_show_details false)})
(plugin :dnlhc/glance.nvim
{:lazy true :config true})
(plugin :smjonas/inc-rename.nvim
{:config #(setup :inc_rename {:input_buffer_type "dressing"})})
{:opts {:input_buffer_type "dressing"}})
; >>>
; cmp <<<
@ -147,9 +146,21 @@
:dependencies ["mattn/webapi-vim"]
:config #(do (set vim.g.rustfmt_fail_silently 1))})
(plugin :simrat39/rust-tools.nvim
(plugin :Saecki/crates.nvim
{:dependencies ["nvim-lua/plenary.nvim"]
:dir "/Users/leon/tmp/crates.nvim"
:event ["BufRead Cargo.toml"]
:lazy true
:opts {:disable_invalid_feature_diagnostic true
:enable_update_available_warning false}})
; temporarily using this fork that merges a few fixes, until simrat is back
(plugin :MunifTanjim/rust-tools.nvim
{:ft ["rust" "toml"]
:dependencies ["nvim-lua/popup.nvim" "nvim-lua/plenary.nvim"]})
;(plugin :simrat39/rust-tools.nvim
;{:ft ["rust" "toml"]
;:dependencies ["nvim-lua/popup.nvim" "nvim-lua/plenary.nvim"]})
(plugin :qnighy/lalrpop.vim {})

View file

@ -1,9 +0,0 @@
(import-macros m :macros)
(m.al utils dots.utils)
(set vim.g.sneak#label 1)
(utils.keymap [:n :o] :<DEL> "<Plug>Sneak_s" {:noremap false})
(utils.keymap [:n :o] :<S-DEL> "<Plug>Sneak_S" {:noremap false})
[]

View file

@ -1,8 +1,7 @@
(import-macros {: al} :macros)
(al utils dots.utils)
(al telescope telescope)
(al actions telescope.actions)
(al colors dots.colors)
(local {: autoload} (require :nfnl.module))
(local utils (autoload :dots.utils))
(local telescope (autoload :telescope))
(local actions (autoload :telescope.actions))
(fn setup []
(telescope.setup
@ -11,7 +10,6 @@
:extensions {:ui-select [((. (require "telescope.themes") :get_dropdown))]}})
(telescope.load_extension "dap")
;(telescope.load_extension "ui-select")
(utils.keymap :n :<C-p> ":Telescope find_files<CR>"))

View file

@ -1,20 +1,12 @@
(import-macros m :macros)
(m.al a nfnl.core)
(m.al utils dots.utils)
(m.al todo-comments todo-comments)
(fn setup []
(todo-comments.setup
{:keywords {:TODO {:icon " "}
:WARN {:icon " " :alt [:WARNING :XXX :!!!]}
:NOTE {:icon " " :alt [:INFO]}
:FIX {:icon " " :alt [:FIXME :BUG :FIXIT :ISSUE :PHIX]}
:PERF {:icon " " :alt [:OPTIM :PERFORMANCE :OPTIMIZE]}
:HACK {:icon " "}}}))
(local utils (require :dots.utils))
[(utils.plugin
:folke/todo-comments.nvim
{:lazy true
:event "VeryLazy"
:config setup})]
:opts {:keywords {:TODO {:icon " "}
:WARN {:icon " " :alt [:WARNING :XXX :!!!]}
:NOTE {:icon " " :alt [:INFO]}
:FIX {:icon " " :alt [:FIXME :BUG :FIXIT :ISSUE :PHIX]}
:PERF {:icon " " :alt [:OPTIM :PERFORMANCE :OPTIMIZE]}
:HACK {:icon " "}}}})]

View file

@ -1,6 +1,4 @@
(import-macros m :macros)
(m.al utils dots.utils)
(m.al a nfnl.core)
(local utils (require :dots.utils))
(fn setup []

View file

@ -6,16 +6,21 @@
(fn setup []
(trouble.setup
{:icons false
:auto_preview true
; disabled due to https://github.com/folke/trouble.nvim/issues/125
:auto_preview false
:auto_close true
:auto_open false
:auto_jump ["lsp_definitions" "lsp_workspace_diagnostics" "lsp_type_definitions"]
:indent_lines false
:multiline false
:action_keys
{:jump "o"
:jump_close "<CR>"
:close "<esc>"
{:jump "<CR>"
:jump_close "o"
:close ["<esc>" "q"]
:cancel "q"
:preview "p"
:toggle_preview "P"
:toggle_mode "m"
:hover ["a" "K"]}})
(utils.highlight "TroubleFoldIcon" {:bg "NONE" :fg colors.bright_orange})

View file

@ -1,5 +1,4 @@
(import-macros m :macros)
(m.al utils dots.utils)
(local utils (require :dots.utils))
(fn setup []
(set vim.g.vimtex_view_method "general")

View file

@ -1,58 +0,0 @@
(al utils dots.utils)
(al a aniseed.core)
(al str aniseed.string)
(al view aniseed.view)
(al popup popup)
(al compe compe)
(defn setup []
(def fuck (require "compe_conjure"))
(def my_source {})
(set my_source.new
(fn []
(setmetatable {} {:__index my_source})))
(set my_source.determine fuck.determine)
(set my_source.get_metadata fuck.get_metadata)
(set my_source.complete fuck.complete)
(set my_source.abort fuck.abort)
(set my_source.documentation
(fn [self args]
(a.println (view.serialise args))
(args.callback
(let [help-tag (help.find-help-tag-for args.completed_item.word)]
(when help-tag
(var lines ["```help"])
(each [_ line (ipairs (help.help-for-tag help-tag))]
(table.insert lines line))
(table.insert lines "```")
lines)))))
(compe.register_source :epic (my_source.new))
(compe.setup
{:enabled true
:autocomplete false
:debug false
:min_length 1
:preselect "enable"
:throttle_time 80
:source_timeout 200
:incomplete_delay 400
:max_abbr_width 100
:max_kind_width 100
:max_menu_width 100
:documentation true
:source {:path true
:buffer true
:calc true
:nvim_lsp true
:nvim_lua true
:vsnip false
:epic true}}))
[]

View file

@ -1,6 +1,6 @@
(import-macros {: al} :macros)
(al a nfnl.core)
(al str nfnl.string)
(local {: autoload} (require :nfnl.module))
(local a (autoload :nfnl.core))
(local str (autoload :nfnl.string))
(fn plugin [name ?opts]
(if (= nil ?opts)
@ -9,7 +9,7 @@
(tset ?opts 1 name)
?opts)))
(fn all [f xs]
(fn all [f]
(not (a.some #(not (f $1)))))
(fn single-to-list [x]
@ -56,7 +56,6 @@
tbl))
(fn without-keys [keys t]
(filter-table #(not (contains? keys $1)) t))
@ -75,16 +74,6 @@
(vim.keymap.del mode from
(if ?buf-local {:buffer 0} {})))
(fn safe-require [name]
(xpcall
#(
;do
;(print name)
;(time
(require name))
#(let [fennel (require :aniseed.fennel)]
(a.println (.. "Error sourcing " name ":\n" (fennel.traceback $1))))))
(fn buffer-content [bufnr]
"Returns a table of lines in the given buffer"
@ -131,27 +120,6 @@
(f (g ...))))
; These are a workaround around broken load order
; mostly used for themeing stuff
; given that the colorscheme may override highlight stuff set before it loaded, this can _ensure_
; that code is ran at the very end of the config
(var deferred-funs [])
(var did-exec-deferred false)
(fn clear-deferred [] (set deferred-funs []))
; defer a function. If deferred funcs have already been ran,
; assume we're reloading config because the user is configuring, and just execute immediately
(fn defer-to-end [f]
(if did-exec-deferred
(f)
(table.insert deferred-funs f)))
(fn run-deferred []
(set did-exec-deferred true)
(each [_ f (ipairs deferred-funs)]
(f)))
(fn get-selection []
(let [[_ s-start-line s-start-col] (vim.fn.getpos "'<")
[_ s-end-line s-end-col] (vim.fn.getpos "'>")
@ -167,7 +135,6 @@
(values s-start-line s-end-line lines)))))
{: plugin
: plugin-installed?
: all
: single-to-list
: contains?
@ -180,14 +147,10 @@
: without-keys
: keymap
: del-keymap
: safe-require
: buffer-content
: surround-if-present
: highlight
: highlight-add
: shorten-path
: comp
: clear-deferred
: defer-to-end
: run-deferred
: get-selection}

View file

@ -13,21 +13,6 @@
`(local ,name ((. (require :nfnl.module) :autoload) ,(tostring thing))))
:defer
(fn [...]
`(let [utils# (require :dots.utils)]
(utils#.defer-to-end (fn [] ,...))))
:req
(fn [name ...]
(let [str (require :nfnl.string)
a (require :nfnl.core)
segs (str.split (tostring name) "%.")
mod (str.join "." (a.butlast segs))
func (a.last segs)]
`((. (require (tostring ,mod)) (tostring ,func)) ,...)))
:autocmd
(fn [...]
`(nvim.ex.autocmd ,...))
@ -40,16 +25,6 @@
(fn [name]
`(.. "lua require('" *module-name* "')['" ,(tostring name) "']()"))
:pkg
(fn [name mappings ...]
`(if (~= nil (. packer_plugins `,(tostring name)))
(let ,mappings ,...)
(print (.. "plugin disabled " `,(tostring name)))))
:vim-let
(fn [field value]
(let [text (.. "let " `,(tostring field) "=\"" value "\"")]
`(vim.cmd ,text)))
:each-pair
(fn [args ...]
@ -59,35 +34,8 @@
(for [i# 1 (a#.count data#) 2]
(let [,l# (. data# i#)
,r# (. data# (+ i# 1))]
,...)))))
:packer-use
(fn [...]
(let [a (require "nfnl.core")
args [...]
use-statements []]
(for [i 1 (a.count args) 2]
(let [name (. args i)
block (. args (+ i 1))]
(a.assoc block 1 name)
(when (. block :mod)
;(a.assoc block :config `#((. (require "utils") :safe-require) ,(. block :mod)))
(a.assoc block :config `#(
;do
;(print ,(. block :mod))
;(time
;(
require ,(. block :mod))))
(a.assoc block :mod)
(table.insert use-statements block)))
(let [use-sym (gensym)]
`(let [packer# (require "packer")]
(packer#.startup
(fn [,use-sym]
,(unpack
(icollect [_# v# (ipairs use-statements)]
`(,use-sym ,v#)))))))))}
,...)))))}

View file

@ -1,33 +1,22 @@
(import-macros {: vim-let} :macros)
(local {: autoload} (require :nfnl.module))
(local a (autoload :aniseed.core))
(local str (autoload :aniseed.string))
(local a (autoload :nfnl.core))
(local str (autoload :nfnl.string))
(local utils (autoload :dots.utils))
(local lazy (require :lazy))
(utils.clear-deferred)
;(macro make-errors-epic [f]
; `(xpcall #,f #(let [fennel# (require :aniseed.fennel)]
; (a.println (fennel#.traceback $1)))))
(macro make-errors-epic [f]
f)
(when (vim.fn.has "termguicolors")
(set vim.opt.termguicolors true))
;(make-errors-epic (require "dots.plugins"))
(vim-let mapleader "\\<Space>")
(vim-let maplocalleader ",")
(vim.cmd "let mapleader=\"\\<Space>\"")
(vim.cmd "let maplocalleader=\",\"")
(lazy.setup {:import "dots.plugins" :install {:colorscheme "gruvbox8"}})
; (require "impatient")
(make-errors-epic (require "dots.plugins.lsp"))
(make-errors-epic (require "dots.keybinds"))
(require "dots.keybinds")
; add to runtimepath
(let [added-paths []]
@ -75,7 +64,7 @@
(set vim.g.AutoPairsMultilineClose 0)
(vim-let &t_ut "")
(vim.cmd "let &t_ut=\"\"")
(vim.api.nvim_create_autocmd "BufWritePost" {:pattern "*.hs" :callback #(set vim.opt.shiftwidth 2)})
(vim.api.nvim_create_autocmd "FileType" {:pattern "vim" :callback #(set vim.opt_local.foldmethod "marker")})
@ -148,6 +137,5 @@
; (vim.cmd "Copilot enable")
(utils.run-deferred)
; vim:foldmarker=foldstart,foldend

View file

@ -1,6 +1,5 @@
{
"agda-vim": { "branch": "master", "commit": "4a0f475aaef756702222bdd5b01e25f814f5691f" },
"aniseed": { "branch": "master", "commit": "7bc09736f3651c10d29b82d1a465b7f540614be1" },
"antifennel-nvim": { "branch": "master", "commit": "79261d02213a5093135e5d02431682f04459f0f7" },
"any-jump.vim": { "branch": "master", "commit": "770ef708ae3f13322430fcc663d7dfb864756b9b" },
"ats-vim": { "branch": "master", "commit": "8e3e722b6d09ed81313573b4e7b108b265628ff1" },
@ -16,6 +15,7 @@
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
"conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" },
"conjure": { "branch": "master", "commit": "58c46d1f4999679659a5918284b574c266a7ac83" },
"copilot.lua": { "branch": "master", "commit": "1a8032ae496916ccc7a7a52ee79194fbef29f462" },
"diffview.nvim": { "branch": "main", "commit": "0437ef8bfdd67156d87140d692840a3c2824fa20" },
"dressing.nvim": { "branch": "master", "commit": "8f4d62b7817455896a3c73cab642002072c114bc" },
"editorconfig-vim": { "branch": "master", "commit": "0d54ea863089fb13be423b4aed6cca35f3a5d778" },
@ -32,7 +32,7 @@
"inc-rename.nvim": { "branch": "main", "commit": "ed0f6f2b917cac4eb3259f907da0a481b27a3b7e" },
"kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" },
"lalrpop.vim": { "branch": "master", "commit": "7073eec8efdeff37cacd4bca378c28dad02c3c14" },
"lazy.nvim": { "branch": "main", "commit": "6b6f0a451200bb6abde85978c577c73ea1577758" },
"lazy.nvim": { "branch": "main", "commit": "25f6009087cc2bb85aedf4425c23f35c03e60b02" },
"litee.nvim": { "branch": "main", "commit": "bf366a1414fd0f9401631ac8884f2f9fa4bf18d2" },
"lsp_lines.nvim": { "branch": "main", "commit": "9e3f99fbbd28aaec80dc0158c43be8cca8dd5017" },
"lsp_signature.nvim": { "branch": "master", "commit": "bdf3dc7bb03edd25c2173e0e31c2fb122052ed23" },
@ -63,19 +63,17 @@
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
"purescript-vim": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" },
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"rust-tools.nvim": { "branch": "patched", "commit": "4338a9b08faa8da8b5aad095a035ceff31301e3f" },
"rust.vim": { "branch": "master", "commit": "889b9a7515db477f4cb6808bef1769e53493c578" },
"sad.vim": { "branch": "master", "commit": "2f5b33b239a566ffedaa81cee3051bb613482d1e" },
"stabilize.nvim": { "branch": "master", "commit": "eeb1873daffaba67246188a5668b366e45ed1de1" },
"startuptime.vim": { "branch": "master", "commit": "dfa57f522d6f61793fe5fea65bca7484751b8ca2" },
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
"tabular": { "branch": "master", "commit": "339091ac4dd1f17e225fe7d57b48aff55f99b23a" },
"targets.vim": { "branch": "master", "commit": "642d3a4ce306264b05ea3219920b13ea80931767" },
"telescope-dap.nvim": { "branch": "master", "commit": "4e2d5efb92062f0b865fe59b200b5ed7793833bf" },
"telescope.nvim": { "branch": "master", "commit": "205f469244916716c49cc2b9026566749425c5ba" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" },
"typescript-vim": { "branch": "master", "commit": "31ede5ad905ce4159a5e285073a391daa3bf83fa" },
"vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" },
"vim-exchange": { "branch": "master", "commit": "784d63083ad7d613aa96f00021cd0dfb126a781a" },
@ -102,6 +100,5 @@
"webapi-vim": { "branch": "master", "commit": "70c49ada7827d3545a65cbdab04c5c89a3a8464e" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"yats.vim": { "branch": "master", "commit": "2b6950c7143790e6930b8cf32d60c6858a50d47c" },
"yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" },
"zen-mode.nvim": { "branch": "main", "commit": "cb73b8bd0ef9d765b942db09dc762c603a89ae44" }
"yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" }
}