summaryrefslogtreecommitdiff
path: root/mut
diff options
context:
space:
mode:
authorMike Vink <mike1994vink@gmail.com>2023-10-08 00:04:52 +0200
committerMike Vink <mike1994vink@gmail.com>2023-10-08 00:04:52 +0200
commit8502175ba08d7b7138e800506c6ad6b61096e93c (patch)
tree6b6d8056f94a9cda748048a36afaa6cf0186f2fe /mut
parentd4ab43855b476eab3b66649c512815c54afc8aa7 (diff)
Start using neovim again
Diffstat (limited to 'mut')
-rw-r--r--mut/neovim/.hotpot.lua12
-rw-r--r--mut/neovim/fnl/conf/events.fnl11
-rw-r--r--mut/neovim/fnl/conf/init.fnl134
-rw-r--r--mut/neovim/fnl/conf/pkgs.fnl7
-rw-r--r--mut/neovim/fnl/conf/pkgs/cmp.fnl101
-rw-r--r--mut/neovim/fnl/conf/pkgs/heirline.fnl241
-rw-r--r--mut/neovim/fnl/conf/pkgs/neotest.fnl4
-rw-r--r--mut/neovim/fnl/conf/pkgs/noice.fnl34
-rw-r--r--mut/neovim/fnl/conf/settings.fnl8
-rw-r--r--mut/neovim/fnl/conf/wict-nvim/builder.fnl99
-rw-r--r--mut/neovim/fnl/conf/wict-nvim/effects.fnl81
-rw-r--r--mut/neovim/fnl/conf/wict-nvim/frames/frame.fnl61
-rw-r--r--mut/neovim/fnl/conf/wict-nvim/frames/vec.fnl28
-rw-r--r--mut/neovim/fnl/conf/wict-nvim/init.fnl31
-rw-r--r--mut/neovim/fnl/conf/wictl-nvim/init.fnl58
-rw-r--r--mut/neovim/fnl/conf/wictl-nvim/resolvers.fnl5
-rw-r--r--mut/neovim/fnl/conf/wictl-nvim/term.fnl54
-rw-r--r--mut/neovim/init.fnl35
-rw-r--r--mut/neovim/init.lua45
-rw-r--r--mut/neovim/test.py0
20 files changed, 73 insertions, 976 deletions
diff --git a/mut/neovim/.hotpot.lua b/mut/neovim/.hotpot.lua
new file mode 100644
index 0000000..4b1d7f7
--- /dev/null
+++ b/mut/neovim/.hotpot.lua
@@ -0,0 +1,12 @@
+return {
+ build = {
+ {verbose = false},
+ -- This will only compile init.fnl, all other fnl/ files will behave as normal.
+ {"fnl/**/*macro*.fnl", false}, -- dont compile macro files
+ {"init.fnl", true},
+ {"fnl/conf/**/*.fnl", true},
+ -- Or you could enable other patterns too,
+ -- {"colors/*.fnl", true},
+ -- {"fnl/**/*.fnl", true},
+ }
+}
diff --git a/mut/neovim/fnl/conf/events.fnl b/mut/neovim/fnl/conf/events.fnl
index 00d75d4..d93f7e0 100644
--- a/mut/neovim/fnl/conf/events.fnl
+++ b/mut/neovim/fnl/conf/events.fnl
@@ -16,17 +16,6 @@
:/.vimsession.vim)))
:group "conf#events"})
-(event [:BufWinEnter :WinEnter]
- {:pattern ["term://*"]
- :callback (fn []
- (vim.cmd :startinsert))
- :group "conf#events"})
-
-(event [:BufLeave] {:pattern ["term://*"]
- :callback (fn []
- (vim.cmd :stopinsert))
- :group "conf#events"})
-
(event [:FileType] {:pattern [:dirvish]
:callback #(vim.cmd "silent! unmap <buffer> <C-p>")
:group "conf#events"})
diff --git a/mut/neovim/fnl/conf/init.fnl b/mut/neovim/fnl/conf/init.fnl
index 90bc20c..3d3c695 100644
--- a/mut/neovim/fnl/conf/init.fnl
+++ b/mut/neovim/fnl/conf/init.fnl
@@ -5,7 +5,8 @@
(vim.cmd "packadd cfilter")
(require :conf.settings)
-;; (require :conf.pkgs)
+(require :conf.pkgs)
+
;; (require :conf.lsp)
;; (require :conf.events)
;; (require :conf.filetype)
@@ -14,8 +15,6 @@
;; (require :conf.diagnostic)
-;; TODO: make a function that sets this autocommand: au BufWritePost currentfile :!curl -X POST -d "{\"previewRun\": true, \"yamlOverride\": \"$(cat % | yq -P)\", \"resources\": {\"repositories\": {\"self\": {\"refName\": \"refs/heads/branch\"}}}}" -s -H "Content-Type: application/json" -H "Authorization: Basic $WORK_AZDO_GIT_AUTH" "$WORK_AZDO_GIT_ORG_URL/Stater/_apis/pipelines/pipelineid/preview?api-version=7.1-preview.1" | jq -r '.finalYaml // .' > scratch.yaml
-
(let [map vim.keymap.set]
(map :t :<c-s> "<c-\\><c-n>")
;; pausing and continueing printing output is not necessary inside neovim terminal right?
@@ -41,132 +40,3 @@
(vim.inspect v))]
(each [_ printer (ipairs inspected)]
(print printer)))))
-
-(local git-worktree (require :git-worktree))
-(git-worktree.setup {:change_directory_command :tcd
- :update_on_change true
- :autopush true})
-
-(fn append [tbl item]
- (table.insert tbl item)
- tbl)
-
-(fn by-newline [lines]
- (fn iter [items by result]
- (local [item & rest] items)
- (if (= item nil) result
- (= "" item) (iter rest [] (append result by))
- (iter rest (append by item) result)))
-
- (ipairs (iter lines [] [])))
-
-(vim.keymap.set [:n] :<leader>w
- (fn []
- (vim.fn.feedkeys ":Worktree switch ")
- (local cmp (require :cmp))
- (vim.schedule (fn []
- (cmp.close)
- (cmp.complete)))))
-
-(vim.keymap.set [:n] :<leader>W ":Worktree ")
-(fn list-worktrees []
- (local pworktree (io.popen "git worktree list --porcelain"))
- (icollect [_ worktree (by-newline (icollect [line (pworktree:lines)]
- line))]
- (match (icollect [_ line (ipairs worktree)]
- (vim.split line " "))
- [[:worktree path] [:HEAD commit] [:branch branch]] (branch:gsub :refs/heads/
- ""))))
-
-(fn list-branches []
- (local pbranch (io.popen "git branch --list -r --format \"%(refname)\""))
- (icollect [_ ref (ipairs (icollect [line (pbranch:lines)]
- (line:gsub :refs/remotes/.+/ "")))]
- (if (not (= ref :HEAD))
- ref)))
-
-(vim.api.nvim_create_user_command :Worktree
- (fn [ctx]
- (match ctx.fargs
- [:create tree branch upstream] (git-worktree.create_worktree tree
- branch
- upstream)
- [:create tree upstream] (git-worktree.create_worktree tree
- tree
- upstream)
- [:create tree] (git-worktree.create_worktree tree
- tree
- :origin)
- [:switch tree] (git-worktree.switch_worktree tree)
- [:delete tree] (git-worktree.delete_worktree tree)
- _ (vim.notify "not recognized")))
- {:nargs "*"
- :complete (fn [lead cmdline cursor]
- (local cmdline-tokens
- (vim.split cmdline " "))
- (match cmdline-tokens
- [:Worktree :create & rest] (list-branches)
- [:Worktree :switch & rest] (list-worktrees)
- [:Worktree :delete & rest] (list-worktrees)
- [:Worktree & rest] [:create
- :switch
- :delete]))})
-
-(vim.api.nvim_create_user_command :HomeManager
- (fn [ctx]
- (vim.cmd (.. ":Dispatch home-manager switch --impure "
- (os.getenv :HOME) "/flake#"
- (. ctx.fargs 1))))
- {:nargs 1})
-
-(vim.api.nvim_create_user_command :Gpush
- (fn [ctx]
- (vim.cmd ":Dispatch git push"))
- {})
-
-(vim.api.nvim_create_user_command :Grunt
- (fn [ctx]
- (match (. ctx.fargs 1)
- :plan (vim.cmd (.. ":Dispatch "
- (if ctx.bang
- "TF_LOG=DEBUG "
- "")
- "terragrunt "
- (table.concat ctx.fargs
- " ")
- " " :-out=gruntplan))
- :apply (vim.cmd (.. ":Dispatch "
- (if ctx.bang
- "TF_LOG=DEBUG "
- "")
- "terragrunt "
- (table.concat ctx.fargs
- " ")
- " " :gruntplan))
- _ (vim.cmd (.. ":Start "
- (if ctx.bang
- "TF_LOG=DEBUG "
- "")
- "terragrunt "
- (table.concat ctx.fargs
- " ")))))
- {:nargs "*" :bang true})
-
-(vim.api.nvim_create_user_command :K9s
- (fn [ctx]
- (vim.cmd (.. ":Start k9s --context "
- (. ctx.fargs 1))))
- {:nargs 1})
-
-(vim.api.nvim_create_user_command :Ssh
- (fn [ctx]
- (vim.cmd (.. ":Start ssh " (. ctx.fargs 1))))
- {:nargs 1
- :complete (fn [lead cmdline cursor]
- (local p
- (io.popen :get-sshables))
- (local lines
- (icollect [line (p:lines)]
- line))
- (p:close)
- lines)})
diff --git a/mut/neovim/fnl/conf/pkgs.fnl b/mut/neovim/fnl/conf/pkgs.fnl
index 1445454..283edb8 100644
--- a/mut/neovim/fnl/conf/pkgs.fnl
+++ b/mut/neovim/fnl/conf/pkgs.fnl
@@ -1,13 +1,12 @@
-;; (require :conf.pkgs.cmp)
+(require :conf.pkgs.cmp)
;; (require :conf.pkgs.null-ls)
;; (require :conf.pkgs.lspconfig)
-;; (require :conf.pkgs.treesitter)
-;; (require :conf.pkgs.tree-sitter-context)
+(require :conf.pkgs.treesitter)
+(require :conf.pkgs.tree-sitter-context)
;; (require :conf.pkgs.conjure)
;; (require :conf.pkgs.test)
;; (require :conf.pkgs.lsp_lines)
-;; (require :conf.pkgs.noice)
;; (require :conf.pkgs.dap)
;; (require :conf.pkgs.heirline)
;; (require :conf.pkgs.gitsigns)
diff --git a/mut/neovim/fnl/conf/pkgs/cmp.fnl b/mut/neovim/fnl/conf/pkgs/cmp.fnl
index 76319f4..732a164 100644
--- a/mut/neovim/fnl/conf/pkgs/cmp.fnl
+++ b/mut/neovim/fnl/conf/pkgs/cmp.fnl
@@ -1,6 +1,4 @@
(local cmp (require :cmp))
-(local compare (require :cmp.config.compare))
-(local always-first [:write :edit :split :quit :cfirst])
(fn string-startswith? [str start]
(= start (string.sub str 1 (string.len start))))
@@ -24,6 +22,12 @@
(local is_string (before:match "%s"))
(and (not= col 0) (= is_string nil)))
+
+(fn edit? []
+ (local line (vim.fn.getcmdline))
+ (not= nil (line:match "ed?i?t? %.*")))
+
+
(fn enum [types key]
(. (. cmp types) key))
@@ -60,55 +64,52 @@
:sources (cmp.config.sources [{:name :nvim_lsp}
{:name :path}
{:name :luasnip}])})
+ (cmp.setup.cmdline
+ ":"
+ {:completion {:completeopt "menu,menuone,noinsert"}
+ :mapping (cmp.mapping.preset.cmdline {
+ :<CR> (cmp.mapping
+ (fn [fallback]
+ (local entry (cmp.get_selected_entry))
+ (if (or (= nil entry) (not (edit?)))
+ (fallback)
+ (do
+ (cmp.confirm {:select true :behavior cmp.ConfirmBehavior.Replace})
+ (if (entry.completion_item.label:match "%.*/$")
+ (do
+ (vim.defer_fn cmp.complete 10))
+ (do
+ (vim.schedule fallback))))))
+ [:i :c])
+ :<BS> {:c (fn [fallback]
+ (if (not (edit?))
+ (fallback)
+ (do
+ (local line (vim.fn.getcmdline))
+ (local key (vim.api.nvim_replace_termcodes "<C-w>" true false true))
+ (if (= nil (line:match "%.*/$"))
+ (vim.api.nvim_feedkeys key :c false)
+ (do
+ (vim.api.nvim_feedkeys (.. key key) :c false)))
+ (vim.defer_fn #(cmp.complete) 10))))}
+ :<C-w> {:c (fn [fallback]
+ (fallback)
+ (vim.defer_fn #(cmp.complete) 10))}
+ :<C-y> {:c (fn [fallback]
+ (cmp.confirm {:select false})
+ (vim.defer_fn #(cmp.complete) 10))}})
+ :sources (cmp.config.sources
+ [{:name :path} {:name :cmdline}])}
+
+
+
(if (not autocomplete) (tset cfg :completion {:autocomplete false}))
;; (print (vim.inspect cfg))
- (cmp.setup cfg)
- (cmp.setup.cmdline ["/" "?"]
- {:sources (cmp.config.sources [{:name :buffer}])
- :experimental {:ghost_text true}
- :mapping (cmp.mapping.preset.cmdline)})
- (cmp.setup.cmdline ":"
- {:matching {:disallow_partial_fuzzy_matching true
- :disallow_prefix_unmatching true}
- :sources (cmp.config.sources [{:name :path}]
- [{:name :cmdline
- :keyword_length 1}])
- :preselect cmp.PreselectMode.Item
- :sorting {:priority_weight 2
- :comparators [(fn [e1 e2]
- (fn iter [[item & rest]]
- (if (or (not rest)
- (not item))
- false
- (= e1.completion_item.label
- item)
- true
- (iter rest)))
+ (cmp.setup cfg))))
- (iter always-first))
- compare.offset
- compare.exact
- compare.score
- compare.locality
- compare.kind
- compare.length
- compare.order]}
- :mapping (cmp.mapping.preset.cmdline {:<CR> {:c (fn [fallback]
- (if (not (cmp.confirm {:behavior (enum :ConfirmBehavior
- :Replace)
- :select true}))
- (fallback)
- (vim.schedule fallback)))}})})))
+(let [map vim.keymap.set]
+ (map :n :<leader>xf (fn []
+ (vim.api.nvim_feedkeys (.. ":e " (vim.fn.getcwd)) :c false)
+ (vim.schedule #(vim.api.nvim_feedkeys "/" :c false)))))
-; {:name :cmdline_history
-; :keyword_pattern "^[ABCDEFHIJKLMNOPQRSTUVWXYZ].*"
-; :entry_filter (fn [entry
-; ctx]
-; (if (string-startswith-upper entry.completion_item.label)
-; true
-; false))
-; :max_item_count 1)})))
-; disallow_fuzzy_matching = false,
-; disallow_partial_matching = false,
-; disallow_prefix_unmatching = false,)))
-(cmp-setup cmp true)
+(cmp-setup (require :cmp) true)
diff --git a/mut/neovim/fnl/conf/pkgs/heirline.fnl b/mut/neovim/fnl/conf/pkgs/heirline.fnl
deleted file mode 100644
index c8d9c52..0000000
--- a/mut/neovim/fnl/conf/pkgs/heirline.fnl
+++ /dev/null
@@ -1,241 +0,0 @@
-(local heirline (require :heirline))
-(local conditions (require :heirline.conditions))
-(local utils (require :heirline.utils))
-(local colors (let [kanagawa-colors (require :kanagawa.colors)]
- (kanagawa-colors.setup)))
-
-(local Align {:provider "%="})
-(local Space {:provider " "})
-(fn with [tbl with-kv]
- (local w {})
- (each [k v (pairs tbl)]
- (tset w k v))
- (each [k v (pairs with-kv)]
- (tset w k v))
- w)
-
-(heirline.load_colors colors)
-(fn palette [name]
- (. colors :palette name))
-
-(fn theme [theme name]
- (. colors :theme theme name))
-
-(var FileNameBlock
- {;; let's first set up some attributes needed by this component and it's children
- :init (lambda [self]
- (tset self :filename (vim.api.nvim_buf_get_name 0)))})
-
-(local FileName
- {:provider (lambda [self]
- ;; first, trim the pattern relative to the current directory. For other
- ;;- options, see :h filename-modifers
- (var filename (vim.fn.fnamemodify (. self :filename) ":."))
- (if (= filename "")
- (set filename "[No Name]")
- ;;- now, if the filename would occupy more than 1/4th of the available
- ;;-- space, we trim the file path to its initials
- ;;-- See Flexible Components section below for dynamic truncation
- (if (not (conditions.width_percent_below (length filename)
- 0.25))
- (set filename (vim.fn.pathshorten filename))))
- filename)
- :hl {:fg (. (utils.get_highlight :Directory) :fg)}})
-
-(local FileNameModifier {:hl (lambda []
- (when vim.bo.modified
- {:fg (theme :diag :warning)
- :bold true
- :force true}))})
-
-(local FileFlags [{:condition (lambda [] vim.bo.modified)
- :provider "[+]"
- :hl {:fg (theme :diag :warning)}}])
-
-(set FileNameBlock (utils.insert FileNameBlock
- (utils.insert FileNameModifier FileName)
- FileFlags {:provider "%<"}))
-
-(local DAPMessages {:condition (lambda []
- (local dap (require :dap))
- (local session (dap.session))
- (not (= session nil)))
- :provider (lambda []
- (local dap (require :dap))
- (.. " " (dap.status)))
- :hl :Debug})
-
-(local Ruler {;; %l = current line number
- ;; %L = number of lines in the buffer
- ;; %c = column number
- ;; %P = percentage through file of displayed window
- :provider "%7(%l/%3L%):%2c %P"})
-
-(local ScrollBar
- {:static {:sbar ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"]}
- ;; Another variant, because the more choice the better.
- ;; sbar { '🭶', '🭷', '🭸', '🭹', '🭺', '🭻'}}
- :provider (lambda [self]
- (local curr_line (. (vim.api.nvim_win_get_cursor 0) 1))
- (local lines (vim.api.nvim_buf_line_count 0))
- (local i
- (- (length self.sbar)
- (math.floor (* (/ (- curr_line 1) lines)
- (length (. self :sbar))))))
- (string.rep (. self :sbar i) 2))
- :hl {:fg (theme :syn :fun) :bg (theme :ui :bg)}})
-
-(local Nix
- {:condition (fn [] vim.env.IN_NIX_SHELL)
- :provider (fn [self]
- (local purity vim.env.IN_NIX_SHELL)
- (local name vim.env.name)
- (.. "" purity "(" name ")"))
- :hl {:fg (theme :syn :fun) :bold true :bg (theme :ui :bg_m3)}})
-
-(local RecordingMacro {:condition #(not= "" (vim.fn.reg_recording))
- :provider (fn [self]
- (.. "Recording... " (vim.fn.reg_recording)))
- :hl {:fg (theme :syn :fun)
- :bold true
- :bg (theme :ui :bg_m3)}})
-
-(local harpoon (require :harpoon))
-(local harpoon-mark (require :harpoon.mark))
-(local harpoon-colors [(theme :syn :identifier)
- (theme :syn :identifier)
- (theme :syn :identifier)])
-
-(fn mark-component [i mark]
- (utils.insert {} {:hl {:bg (if (= mark.filename
- (vim.fn.fnamemodify (vim.api.nvim_buf_get_name 0)
- ":."))
- (theme :ui :bg_p1)
- (theme :ui :bg_m1))
- :bold true
- :fg (. harpoon-colors i)}
- :provider (fn [self]
- (.. " M" i " "))}))
-
-;{:hl {:fg (theme :syn :fun)} :provider (vim.fn.pathshorten mark.filename)}))
-; {:hl {:bold true :fg (. harpoon-colors i)} :provider ")"} Space))
-
-(local HarpoonMarks
- (utils.insert {:hl :TabLineSel
- :condition #(< 0
- (length (. (harpoon.get_mark_config)
- :marks)))}
- {:init (lambda [self]
- (local mark-list
- (. (harpoon.get_mark_config) :marks))
- (each [i mark (ipairs mark-list)]
- (tset self i
- (self:new (mark-component i mark) i)))
- (while (> (length self) (length mark-list))
- (table.remove self (length self))))}))
-
-(local Tabpage
- {:provider (lambda [self]
- (fn fnamemod [name mod]
- (vim.fn.fnamemodify name mod))
-
- (fn format-name [name]
- (if (= name "") "[No Name]"
- (fnamemod name ":t")))
-
- (.. "%" self.tabnr "T " self.tabnr " "))
- :hl (lambda [self]
- (if (not self.is_active) :TabLine :TabLineSel))})
-
-(fn active-tab-hrpn [self]
- (local hl {})
- (if (. self :is_active)
- (do
- (tset hl :fg (theme :syn :identifier))
- (tset hl :bold true)))
- hl)
-
-(fn active-hl [hl]
- (lambda [self]
- (if self.is_active
- hl
- {})))
-
-(fn tab-visible-buffers [tab]
- (local visible (vim.fn.tabpagebuflist tab))
- (if (= visible 0)
- []
- visible))
-
-(fn tab-harpoon-marks [tab]
- (local visible (tab-visible-buffers tab))
- (local tab-buffers (accumulate [buffers [] _ buf (ipairs visible)]
- (do
- (if (not (vim.tbl_contains buffers buf))
- (table.insert buffers buf))
- buffers)))
- (icollect [_ buf (ipairs tab-buffers)]
- (do
- (local status (harpoon-mark.status buf))
- (if (not= status "")
- status))))
-
-(local Tabpage
- (utils.insert Tabpage {:hl active-tab-hrpn :provider "🌊 [ "}
- {:hl (active-hl {:fg (theme :syn :fun)})
- :provider (lambda [self]
- (local harpoon_marks
- (tab-harpoon-marks self.tabnr))
- (table.concat harpoon_marks " "))}
- {:hl active-tab-hrpn :provider " ] %T"}))
-
-(local TabpageClose {:provider "%999X  %X" :hl :TabLine})
-
-(local TabPages
- {;; only show this component if there's 2 or more tabpages
- :condition (lambda []
- (>= (length (vim.api.nvim_list_tabpages)) 1))})
-
-(local TabPages (utils.insert TabPages (utils.make_tablist Tabpage)
- TabpageClose))
-
-(local dispatch-get-request (. vim.fn "dispatch#request"))
-(local Dispatch (utils.insert {:init (fn [self]
- (set self.req (dispatch-get-request)))
- :condition (fn []
- (not (vim.tbl_isempty (dispatch-get-request))))}
- {:provider "dispatch("
- :hl (fn [self]
- {:fg (if (= 1 self.req.completed)
- (theme :syn :fun)
- (theme :diag :warning))
- :bold true})}
- {:provider (fn [self]
- self.req.command)
- :hl {:fg (theme :syn :string) :bold false}}
- {:provider ")"
- :hl (fn [self]
- {:fg (if (= 1 self.req.completed)
- (theme :syn :fun)
- (theme :diag :warning))
- :bold true})}))
-
-(local StatusLine [FileNameBlock
- Space
- HarpoonMarks
- Space
- TabPages
- DAPMessages
- Space
- RecordingMacro
- Dispatch
- Align
- Space
- Nix
- Space
- Ruler
- Space
- ScrollBar
- Space])
-
-(heirline.setup {:statusline StatusLine})
diff --git a/mut/neovim/fnl/conf/pkgs/neotest.fnl b/mut/neovim/fnl/conf/pkgs/neotest.fnl
deleted file mode 100644
index 251cdcb..0000000
--- a/mut/neovim/fnl/conf/pkgs/neotest.fnl
+++ /dev/null
@@ -1,4 +0,0 @@
-(let [nt (require :neotest)
- python (require :neotest-python)]
- (nt.setup {:adapters [(python {:dap {:justMyCode false}})]}))
-
diff --git a/mut/neovim/fnl/conf/pkgs/noice.fnl b/mut/neovim/fnl/conf/pkgs/noice.fnl
deleted file mode 100644
index 58ac761..0000000
--- a/mut/neovim/fnl/conf/pkgs/noice.fnl
+++ /dev/null
@@ -1,34 +0,0 @@
-(local noice (require :noice))
-(noice.setup {:views {:cmdline_popup {:border {:style :none :padding [1 3]}
- :win_options {:winhighlight "NormalFloat:NormalFloat,FloatBorder:FloatBorder"}}}
- :lsp {;; override markdown rendering so that **cmp** and other plugins use **Treesitter**
- :override {[:vim.lsp.util.convert_input_to_markdown_lines] true
- [:vim.lsp.util.stylize_markdown] true
- [:cmp.entry.get_documentation] true}}
- :popupmenu {:enabled false}
- :messages {; NOTE: If you enable messages then the cmdline is enabled automatically.
- ; This is a current Neovim limitation.
- :enabled true
- ; enables the Noice messages UI
- :view :mini
- ; default view for messages
- :view_error :mini
- ; view for errors
- :view_warn :mini
- ; view for warnings
- :view_history :mini
- ; view for :messages
- :view_search :virtualtext}
- ; view for search count messages. Set to `false` to disable}
- ;; you can enable a preset for easier configuration
- :presets {:bottom_search true
- ; use a classic bottom cmdline for search
- :command_palette true
- ; position the cmdline and popupmenu together
- :long_message_to_split true
- ; long messages will be sent to a split
- :inc_rename false
- ; enables an input dialog for inc-rename.nvim
- :lsp_doc_border false}})
-
-; add a border to hover docs and signature help}})
diff --git a/mut/neovim/fnl/conf/settings.fnl b/mut/neovim/fnl/conf/settings.fnl
index ec68e6c..99bbcc9 100644
--- a/mut/neovim/fnl/conf/settings.fnl
+++ b/mut/neovim/fnl/conf/settings.fnl
@@ -56,8 +56,10 @@
relativenumber on
exrc on
secure on
- completeopt "menuone,noselect"
- wildmode "lastused"
+ completeopt "menu,longest,preview"
+ wmnu on
+ wop "pum"
+ wildmode "list:longest"
complete ".,w,k,kspell,b"
foldopen "block,hor,jump,mark,percent,quickfix,search,tag"
laststatus 3
@@ -66,4 +68,4 @@
hlsearch off
clipboard ""
showtabline 0
- cmdheight 0)
+ cmdheight 1)
diff --git a/mut/neovim/fnl/conf/wict-nvim/builder.fnl b/mut/neovim/fnl/conf/wict-nvim/builder.fnl
deleted file mode 100644
index 177b773..0000000
--- a/mut/neovim/fnl/conf/wict-nvim/builder.fnl
+++ /dev/null
@@ -1,99 +0,0 @@
-(tset package.loaded :conf.wict-nvim.frames.frame nil)
-(local vec (require :conf.wict-nvim.frames.vec))
-(local frame (require :conf.wict-nvim.frames.frame))
-(local m {})
-
-;; Creates a new painter that wraps the paint and close methods of a painter
-(local transform-painter (fn [painter ori width height]
- (fn [frm]
- (local coord (frame.frame->coord frm))
- (local new-ori (coord ori))
- (local new-frame
- (frame new-ori
- (vec.sub (coord width) new-ori)
- (vec.sub (coord height) new-ori)))
- (painter new-frame))))
-
-(local pad (fn [painter pad-size]
- (fn [frm]
- (local pad-width (/ pad-size (frame.width frm)))
- (local pad-height (/ pad-size (frame.height frm)))
- (local transformed
- (transform-painter painter (vec.vec pad-width pad-height)
- (vec.vec (- 1 pad-width) pad-height)
- (vec.vec pad-width (- 1 pad-height))))
- (transformed frm))))
-
-(local beside (fn [p1 p2 size]
- (local size (or size 0.5))
- (local left
- (transform-painter p1 (vec.vec 0 0) (vec.vec size 0)
- (vec.vec 0 1)))
- (local right
- (transform-painter p2 (vec.vec size 0) (vec.vec 1 0)
- (vec.vec size 1)))
- (fn [frm]
- (left frm)
- (right frm))))
-
-(local builder {})
-
-(fn builder.Padding [self size]
- (table.insert self.partial-painters {:op :pad : size})
- self)
-
-(fn builder.Beside [self partial-builder size]
- (table.insert self.partial-painters {:op :beside : partial-builder : size})
- self)
-
-(fn builder.LeftOf [self partial-builder size]
- (table.insert self.partial-painters {:op :left : partial-builder : size})
- self)
-
-(fn builder.RightOf [self partial-builder size]
- (table.insert self.partial-painters {:op :right : partial-builder : size})
- self)
-
-(fn builder.build-painter [self effects]
- (accumulate [painter (fn [frame] (print :leaf-painter)) _ partial-painter (ipairs self.partial-painters)]
- (do
- (match partial-painter
- {:op :pad : size} (do
- (pad painter size))
- {:op :left : partial-builder} (do
- (beside painter
- (partial-builder:build-painter effects)
- partial-painter.size))
- {:op :right : partial-builder} (do
- (beside (partial-builder:build-painter effects)
- painter partial-painter.size))
- {:op :beside : partial-builder} (do
- (beside painter
- (partial-builder:build-painter effects)
- partial-painter.size))
- {: maps : buffer} (do
- (local window (effects:new-window maps))
- (local painter-ptr painter)
- (fn [frm]
- (local frame-opts
- (frame.frame->open-win-options frm))
- (local buf (buffer))
- (if (not (window:open?))
- (window:open buf frame-opts)
- (window:repaint buf frame-opts))
- (painter-ptr frm)))
- _ painter))))
-
-(fn builder.Build [self effects]
- (local painter (self:build-painter effects))
- (fn [frm]
- (effects:attach)
- (painter frm)))
-
-(fn builder.For [partial-painter]
- (local bldr {:partial-painters [partial-painter]})
- (setmetatable bldr builder)
- (set builder.__index builder)
- bldr)
-
-builder
diff --git a/mut/neovim/fnl/conf/wict-nvim/effects.fnl b/mut/neovim/fnl/conf/wict-nvim/effects.fnl
deleted file mode 100644
index e4321da..0000000
--- a/mut/neovim/fnl/conf/wict-nvim/effects.fnl
+++ /dev/null
@@ -1,81 +0,0 @@
-(local m {})
-(local window {})
-
-(local aug vim.api.nvim_create_augroup)
-(local del-aug (fn [] (vim.api.nvim_create_augroup :EffectsMgr {:clear true})))
-(local au vim.api.nvim_create_autocmd)
-(local winvar (fn [...] (pcall vim.api.nvim_win_get_var ...)))
-(local unmap (fn [{: mode : lhs : opts}] (pcall vim.keymap.del mode lhs opts)))
-(local map (fn [mode lhs rhs opts] (vim.keymap.set mode lhs rhs opts)))
-
-(fn window.close [self]
- (if (self:open?)
- (set self.handle (vim.api.nvim_win_close self.handle true))))
-
-(fn window.open [self buf frame]
- (set frame.style :minimal)
- (set self.handle (vim.api.nvim_open_win buf false frame))
- (P self.handle :before-setvar)
- (vim.api.nvim_buf_set_var buf :effect-window self)
- (vim.api.nvim_win_set_var self.handle :effect-window self)
- (if self.enter
- (vim.api.nvim_set_current_win self.handle)))
-
-(fn window.id [self]
- self.handle)
-
-(fn window.open? [self]
- (if self.handle
- (vim.api.nvim_win_is_valid self.handle) false))
-
-(fn window.new [self i enter maps]
- (local w (setmetatable {: i : enter : maps} window))
- (set self.__index self)
- w)
-
-(fn m.new-window [self maps]
- (local w (window:new (+ (length self.windows) 1) (= (length self.windows) 0)
- maps))
- (table.insert self.windows w)
- w)
-
-(fn m.close [self]
- (each [_ w (ipairs self.windows)]
- (w:close))
- (if self.augroup
- (set self.augroup (del-aug self.augroup)))
- (if self.unmap
- (set self.unmap (self.unmap))))
-
-(fn m.attach [self]
- (set self.augroup (aug :EffectsMgr {:clear true}))
- (au [:WinEnter]
- {:group self.augroup
- :pattern "*"
- :callback (fn [cb-info]
- (P :effectEnter)
- (local (ok? win) (winvar 0 :effect-window))
- (P ok? win)
- (if (not ok?)
- (self:close)
- (do
- (if win.maps
- (self:win-maps win)))))}))
-
-(fn m.win-maps [self win]
- (P win)
- (if self.unmap
- (self.unmap))
- (set self.unmap (fn []
- (each [_ m (ipairs win.maps)]
- (unmap m))))
- (each [_ {: mode : lhs : rhs : opts} (ipairs win.maps)]
- (map mode lhs (rhs self win) opts)))
-
-(fn m.new [self opts]
- (local effects {:windows []})
- (setmetatable effects self)
- (set self.__index self)
- effects)
-
-m
diff --git a/mut/neovim/fnl/conf/wict-nvim/frames/frame.fnl b/mut/neovim/fnl/conf/wict-nvim/frames/frame.fnl
deleted file mode 100644
index d32c9b5..0000000
--- a/mut/neovim/fnl/conf/wict-nvim/frames/frame.fnl
+++ /dev/null
@@ -1,61 +0,0 @@
-(local vec (require :conf.wict-nvim.frames.vec))
-(local m {})
-(local frame {})
-
-;; frame is interpreted as matrix coords
-;; origin ------------------> ne-edge
-;; |
-;; |
-;; |
-;; |
-;; |
-;; |
-;;\ /
-;; .
-;; sw-edge
-(fn frame.make [self ori width height]
- (local f {: ori : width : height})
- (setmetatable f self)
- (set self.__index self)
- f)
-
-(fn frame.origin [f]
- f.ori)
-
-(fn frame.width-edge [f]
- f.width)
-
-(fn frame.height-edge [f]
- f.height)
-
-(fn m.frame->coord [f]
- (fn [v]
- (vec.add (f:origin)
- (vec.add (vec.scale (v:x-coord) (f:width-edge))
- (vec.scale (v:y-coord) (f:height-edge))))))
-
-(fn m.width [f]
- (let [width-edge (f:width-edge)]
- (width-edge:x-coord)))
-
-(fn m.height [f]
- (let [height-edge (f:height-edge)]
- (height-edge:y-coord)))
-
-(fn m.frame->open-win-options [f anchor]
- (local coord (m.frame->coord f))
- (local ori (f:origin))
- (local width-edge (f:width-edge))
- (local height-edge (f:height-edge))
- (local anchor (or anchor :NW))
- {:width (width-edge:x-coord)
- :height (height-edge:y-coord)
- :col (ori:x-coord)
- :row (ori:y-coord)
- : anchor
- :relative :editor})
-
-(setmetatable m {:__call (fn [self ...]
- (frame:make ...))})
-
-m
diff --git a/mut/neovim/fnl/conf/wict-nvim/frames/vec.fnl b/mut/neovim/fnl/conf/wict-nvim/frames/vec.fnl
deleted file mode 100644
index 4a9515d..0000000
--- a/mut/neovim/fnl/conf/wict-nvim/frames/vec.fnl
+++ /dev/null
@@ -1,28 +0,0 @@
-(local m {})
-(local vec {})
-
-(fn vec.make [self x y]
- (local v {: x : y})
- (setmetatable v self)
- (set self.__index self)
- v)
-
-(fn vec.x-coord [v]
- v.x)
-
-(fn vec.y-coord [v]
- v.y)
-
-(fn m.add [v1 v2]
- (vec:make (+ (v1:x-coord) (v2:x-coord)) (+ (v1:y-coord) (v2:y-coord))))
-
-(fn m.sub [v1 v2]
- (vec:make (- (v1:x-coord) (v2:x-coord)) (- (v1:y-coord) (v2:y-coord))))
-
-(fn m.scale [a v]
- (vec:make (math.floor (* a (v:x-coord))) (math.floor (* a (v:y-coord)))))
-
-(fn m.vec [...]
- (vec:make ...))
-
-m
diff --git a/mut/neovim/fnl/conf/wict-nvim/init.fnl b/mut/neovim/fnl/conf/wict-nvim/init.fnl
deleted file mode 100644
index 9e40fad..0000000
--- a/mut/neovim/fnl/conf/wict-nvim/init.fnl
+++ /dev/null
@@ -1,31 +0,0 @@
-(tset package.loaded :conf.wict-nvim.frames.vec nil)
-(local vec (require :conf.wict-nvim.frames.vec))
-
-(tset package.loaded :conf.wict-nvim.frames.frame nil)
-(local frame (require :conf.wict-nvim.frames.frame))
-
-(tset package.loaded :conf.wict-nvim.builder nil)
-(local builder (require :conf.wict-nvim.builder))
-
-(tset package.loaded :conf.wict-nvim.effects nil)
-(local effects (require :conf.wict-nvim.effects))
-
-(local m {})
-
-(local root-frame (frame (vec.vec 0 0) (vec.vec vim.o.columns 0)
- (vec.vec 0 vim.o.lines)))
-
-(local painter (-> (builder.For {:buffer (fn [] 0)
- :maps [{:mode [:n :v :o]
- :lhs :q
- :rhs (fn [effects window]
- (fn []
- (effects:close)))}]})
- (builder.Beside (-> (builder.For {:buffer (fn [] 0)
- :maps []}))
- 0.5)
- (builder.Padding 5)
- (builder.Build (effects:new))))
-
-; (painter root-frame)
-{: root-frame : builder : effects}
diff --git a/mut/neovim/fnl/conf/wictl-nvim/init.fnl b/mut/neovim/fnl/conf/wictl-nvim/init.fnl
deleted file mode 100644
index bd04182..0000000
--- a/mut/neovim/fnl/conf/wictl-nvim/init.fnl
+++ /dev/null
@@ -1,58 +0,0 @@
-(local Path (require :plenary.path))
-(tset package.loaded :conf.wict-nvim nil)
-(local wict (require :conf.wict-nvim))
-(tset package.loaded :conf.wictl-nvim.resolvers nil)
-(local Resolver (require :conf.wictl-nvim.resolvers))
-
-(local bld wict.builder)
-(local eff wict.effects)
-
-(local config_path (vim.fn.stdpath :config))
-(local data_path (vim.fn.stdpath :data))
-(local user_config (string.format "%s/wictl.json" config_path))
-(local cache_config (string.format "%s/wictl.json" data_path))
-
-(local m {})
-
-(local WictlConfig {})
-;; {
-;; ["/path/to/project"] = {
-;; terms = [{cmd = "k9s"}]
-;; }
-
-(fn m.Edit [project])
-
-(fn m.Read [path]
- (local p (Path:new path))
- (vim.fn.json_decode (p:read)))
-
-(fn m.Save []
- (local cache-path (Path:new cache_config))
- (cache-path:write (vim.fn.json_encode WictlConfig) :w))
-
-(local ensure-complete-project (fn [config]
- (var config (or config {:terms []}))
- (if (not config.terms)
- (set config.terms
- [{:name :k9s :cmd :bash}]))
- config))
-
-(local get-project (fn []
- (local proj (. WictlConfig (Resolver.project_key)))
- (ensure-complete-project (or proj
- (do
- (local cfg {})
- (tset WictlConfig
- (Resolver.project_key)
- cfg)
- cfg)))))
-
-(fn m.Get-Terms-Config []
- (local proj (get-project))
- proj.terms)
-
-(m.Save)
-(m.Read cache_config)
-(m.Get-Terms-Config)
-
-m
diff --git a/mut/neovim/fnl/conf/wictl-nvim/resolvers.fnl b/mut/neovim/fnl/conf/wictl-nvim/resolvers.fnl
deleted file mode 100644
index df5f2ac..0000000
--- a/mut/neovim/fnl/conf/wictl-nvim/resolvers.fnl
+++ /dev/null
@@ -1,5 +0,0 @@
-(local m {})
-(fn m.project_key []
- (vim.loop.cwd))
-
-m
diff --git a/mut/neovim/fnl/conf/wictl-nvim/term.fnl b/mut/neovim/fnl/conf/wictl-nvim/term.fnl
deleted file mode 100644
index 51e263a..0000000
--- a/mut/neovim/fnl/conf/wictl-nvim/term.fnl
+++ /dev/null
@@ -1,54 +0,0 @@
-(tset package.loaded :conf.wict-nvim nil)
-(local ui (require :conf.wict-nvim))
-(tset package.loaded :conf.wict-nvim.effects nil)
-(local ui-eff (require :conf.wict-nvim.effects))
-
-(tset package.loaded :conf.wictl-nvim nil)
-(local wictl (require :conf.wictl-nvim))
-
-(local Resolver (require :conf.wictl-nvim.resolvers))
-(local ui-bld ui.builder)
-(local M {})
-
-(local ProjectBufs {})
-(var selected nil)
-(local term-ui (-> (ui-bld.For {:buffer (fn [] selected)
- :maps [{:mode [:n :v :o]
- :lhs :q
- :rhs (fn [effects window]
- (fn []
- (P :quitting!)
- (effects:close)))}]})
- (ui-bld.Padding 2)
- (ui-bld.Build (ui-eff:new))))
-
-(fn M.open [idx]
- (local new-term-buf (fn []
- (local (buf_handle term_handle) (M.start idx))
- (tset ProjectBufs (Resolver.project_key) idx
- {: buf_handle : term_handle})
- {: buf_handle : term_handle}))
- (local proj (or (. ProjectBufs (Resolver.project_key))
- (do
- (local p [])
- (tset ProjectBufs (Resolver.project_key) p)
- p)))
- (var term (or (. proj idx) (new-term-buf)))
- (if (or (not (vim.api.nvim_buf_is_valid term.buf_handle))
- (not (vim.api.nvim_buf_get_var term.buf_handle :terminal_job_id)))
- (set term (new-term-buf)))
- (set selected term.buf_handle)
- (term-ui ui.root-frame))
-
-(fn M.start [idx]
- (P :starting)
- (local term (. (wictl.Get-Terms-Config) idx))
- (local prestart-buf (vim.api.nvim_get_current_buf))
- (vim.cmd (.. "edit term://" term.cmd))
- (local buf_handle (vim.api.nvim_get_current_buf))
- (local term_handle vim.b.terminal_job_id)
- (vim.api.nvim_buf_set_option buf_handle :bufhidden :hide)
- (vim.api.nvim_set_current_buf prestart-buf)
- (values buf_handle term_handle))
-
-M
diff --git a/mut/neovim/init.fnl b/mut/neovim/init.fnl
index 7e82675..a46445c 100644
--- a/mut/neovim/init.fnl
+++ b/mut/neovim/init.fnl
@@ -1,36 +1 @@
-;; fixes nixpkgs hotpot not adding package path correctly
-
-(tset _G.package :path
- (.. (vim.fn.stdpath :cache) "/hotpot/hotpot.nvim/lua/?/init.lua;"
- package.path))
-
-(fn build-init []
- (let [{: build} (require :hotpot.api.make)
- allowed-globals (icollect [n _ (pairs _G)]
- n)
- opts {:verbosity 0
- :compiler {:modules {:allowedGlobals allowed-globals}}}
- here #(values $1)
- config-path (vim.fn.stdpath :config)]
- (build config-path opts (.. config-path :/init.fnl) here
- (.. config-path :/after/ftdetect/.+) here
- (.. config-path :/ftplugin/.+) here
- (.. config-path :/after/ftplugin/.+) here)))
-
-;; Call hotpot.setup and compile again after fs event
-
-(let [hotpot (require :hotpot)
- setup hotpot.setup
- build hotpot.api.make.build
- uv vim.loop
- config-path (vim.fn.stdpath :config)]
- (setup {:provide_require_fennel true
- :compiler {:modules {:correlate true}
- :macros {:env :_COMPILER
- :compilerEnv _G
- :allowedGlobals false}}})
- (let [handle (uv.new_fs_event)
- path (vim.fn.expand (.. config-path :/init.fnl))]
- (uv.fs_event_start handle path {} #(vim.schedule build-init))
- (vim.api.nvim_create_autocmd :VimLeavePre {:callback #(uv.close handle)})))
(require :conf)
diff --git a/mut/neovim/init.lua b/mut/neovim/init.lua
index 3de4446..bf643df 100644
--- a/mut/neovim/init.lua
+++ b/mut/neovim/init.lua
@@ -1,46 +1 @@
-_G.package["path"] = (vim.fn.stdpath("cache") .. "/hotpot/hotpot.nvim/lua/?/init.lua;" .. package.path)
-local function build_init()
- local _let_1_ = require("hotpot.api.make")
- local build = _let_1_["build"]
- local allowed_globals
- do
- local tbl_17_auto = {}
- local i_18_auto = #tbl_17_auto
- for n, _ in pairs(_G) do
- local val_19_auto = n
- if (nil ~= val_19_auto) then
- i_18_auto = (i_18_auto + 1)
- do end (tbl_17_auto)[i_18_auto] = val_19_auto
- else
- end
- end
- allowed_globals = tbl_17_auto
- end
- local opts = {verbosity = 0, compiler = {modules = {allowedGlobals = allowed_globals}}}
- local here
- local function _3_(_241)
- return _241
- end
- here = _3_
- local config_path = vim.fn.stdpath("config")
- return build(config_path, opts, (config_path .. "/init.fnl"), here, (config_path .. "/after/ftdetect/.+"), here, (config_path .. "/ftplugin/.+"), here, (config_path .. "/after/ftplugin/.+"), here)
-end
-do
- local hotpot = require("hotpot")
- local setup = hotpot.setup
- local build = hotpot.api.make.build
- local uv = vim.loop
- local config_path = vim.fn.stdpath("config")
- setup({provide_require_fennel = true, compiler = {modules = {correlate = true}, macros = {env = "_COMPILER", compilerEnv = _G, allowedGlobals = false}}})
- local handle = uv.new_fs_event()
- local path = vim.fn.expand((config_path .. "/init.fnl"))
- local function _4_()
- return vim.schedule(build_init)
- end
- uv.fs_event_start(handle, path, {}, _4_)
- local function _5_()
- return uv.close(handle)
- end
- vim.api.nvim_create_autocmd("VimLeavePre", {callback = _5_})
-end
return require("conf") \ No newline at end of file
diff --git a/mut/neovim/test.py b/mut/neovim/test.py
deleted file mode 100644
index e69de29..0000000
--- a/mut/neovim/test.py
+++ /dev/null