summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
Diffstat (limited to 'fnl')
-rw-r--r--fnl/config.fnl6
-rw-r--r--fnl/plugins/compile-mode.fnl20
-rw-r--r--fnl/plugins/leap.fnl1
-rw-r--r--fnl/settings/autocmds.fnl6
-rw-r--r--fnl/settings/keymaps.fnl2
-rw-r--r--fnl/settings/options.fnl2
6 files changed, 34 insertions, 3 deletions
diff --git a/fnl/config.fnl b/fnl/config.fnl
index cf50b2f..478bae2 100644
--- a/fnl/config.fnl
+++ b/fnl/config.fnl
@@ -7,12 +7,16 @@
(local {: apply-to-files} (require :util.load))
+(local api (require :hotpot.api))
+(local context (assert (api.context (vim.fn.stdpath :config))))
+
(local opts {:install {:colorscheme [:no-clown-fiesta]}
:debug false
:defaults {:lazy false}
:dev {:path (.. (vim.fn.expand :$HOME) :/projects)}
:performance {:cache {:enabled true}
- :rtp {:disabled_plugins [:gzip
+ :rtp {:paths [(context.locate :destination)]
+ :disabled_plugins [:gzip
:matchit
:netrwPlugin
:tarPlugin
diff --git a/fnl/plugins/compile-mode.fnl b/fnl/plugins/compile-mode.fnl
new file mode 100644
index 0000000..b8d9c53
--- /dev/null
+++ b/fnl/plugins/compile-mode.fnl
@@ -0,0 +1,20 @@
+(local keys
+ [{1 :<m-c> 2 :<cmd>Compile<cr> :desc :Compile}
+ {1 :<m-C> 2 :<cmd>Recompile<cr> :desc :Recompile}
+ {1 "]e" 2 :<cmd>NextError<cr> :desc "Next compile error"}
+ {1 "[e" 2 :<cmd>PrevError<cr> :desc "Prev compile error"}])
+
+(λ config []
+ (set vim.g.compile_mode {:default_command {:ocaml "dune build"}
+ :bang_expansion true
+ :recompile_no_fail true
+ :auto_jump_to_first_error false
+ :ask_about_save true
+ :ask_to_interrupt true
+ :auto_scroll true}))
+
+{1 :ej-shafran/compile-mode.nvim
+ :version :^5.0.0
+ :dependencies [:nvim-lua/plenary.nvim]
+ : config
+ : keys}
diff --git a/fnl/plugins/leap.fnl b/fnl/plugins/leap.fnl
index 3c846c5..397b873 100644
--- a/fnl/plugins/leap.fnl
+++ b/fnl/plugins/leap.fnl
@@ -40,6 +40,7 @@
(vim.keymap.set [:n] :gs "<Plug>(leap-from-window)")))
{:url "https://codeberg.org/andyg/leap.nvim"
+:name :leap.nvim
: dependencies
:event :VeryLazy
: config}
diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl
index b2a065c..9b5eac5 100644
--- a/fnl/settings/autocmds.fnl
+++ b/fnl/settings/autocmds.fnl
@@ -12,7 +12,11 @@
[:FileType
{:pattern [:gitcommit :markdown] :command "setlocal wrap"}]
[:VimResized {:command "tabdo wincmd ="}]
- [[:FocusGained :BufEnter] {:command :checktime}]
+ [[:FocusGained :BufEnter :CursorHold :CursorHoldI]
+ {:pattern "*"
+ :callback (fn []
+ (when (= (vim.fn.mode) :n)
+ (vim.cmd :checktime)))}]
[[:InsertLeave :WinEnter]
{:callback (λ []
(let [cursorline (require :settings.cursorline)]
diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl
index aa32316..14cd160 100644
--- a/fnl/settings/keymaps.fnl
+++ b/fnl/settings/keymaps.fnl
@@ -33,6 +33,8 @@
[:n :<c-u> :<c-u>zz {}]
;; Remove highlighted search
[:n :<m-h> :<cmd>nohlsearch<CR> {}]
+ ;; jump to eol in insert mode
+ [:i :<c-e> :<c-o>$ {}]
;; Force refresh
[:n :mj "<cmd>:e<CR>" {:desc :Refresh}]])
diff --git a/fnl/settings/options.fnl b/fnl/settings/options.fnl
index c72d415..e7ece5f 100644
--- a/fnl/settings/options.fnl
+++ b/fnl/settings/options.fnl
@@ -43,7 +43,7 @@
;; enable persistent undo
:undofile true
;; faster completion (4000ms default)
- :updatetime 100
+ :updatetime 1000
;; if a file is being edited by another program (or was written
;; to file while editing with another program), it is not allowed
;; to be edited