summaryrefslogtreecommitdiff
path: root/nvim/init.fnl
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/init.fnl')
m---------nvim0
-rw-r--r--nvim/init.fnl63
2 files changed, 63 insertions, 0 deletions
diff --git a/nvim b/nvim
deleted file mode 160000
-Subproject d2e1e6a0d60cf427a8a56c0caf57c8ec60a8e36
diff --git a/nvim/init.fnl b/nvim/init.fnl
new file mode 100644
index 0000000..d4b2f73
--- /dev/null
+++ b/nvim/init.fnl
@@ -0,0 +1,63 @@
+(macro conf [...]
+ (let [bindings [...]
+ result []]
+ (for [i 1 (length bindings) 2]
+ (let [k (. bindings i)
+ v (. bindings (+ i 1))]
+ (table.insert result `(set ,k ,v))))
+ `(do ,(unpack result))))
+
+(conf vim.g.mapleader " "
+ vim.g.maplocalleader "\\"
+ ;; disable built-in tree
+ vim.g.loaded_netrw 1
+ vim.g.loaded_netrwPlugin 1
+ ;; enable true color
+ vim.opt.termguicolors true
+ ;; show line numbers
+ vim.o.number true
+ ;; ensure new line at EOF
+ vim.opt.endofline true
+ vim.opt.fixendofline true
+ ;; tab width
+ vim.opt.tabstop 4
+ vim.opt.shiftwidth 4
+ vim.opt.expandtab true
+ ;; disable providers
+ vim.g.loaded_perl_provider 0
+ vim.g.loaded_ruby_provider 0)
+
+;; cursorline
+(vim.cmd "set cursorline")
+
+;; Show diagnostics
+(vim.diagnostic.config {:virtual_text true
+ :signs true
+ :underline true
+ :update_in_insert false})
+
+;; Escape TERMINAL mode using ESC
+(vim.api.nvim_set_keymap
+ "t" "<Esc>" "<C-\\><C-n>" { "desc" "Exit terminal mode" })
+
+;; tab management
+(vim.api.nvim_set_keymap
+ "n" "t" ":tabnew<Enter>" { "desc" "create new tab" })
+(vim.api.nvim_set_keymap
+ "n" "T" ":tabn<Enter>" { "desc" "jump to new tab" })
+(vim.api.nvim_set_keymap
+ "n" "X" ":tabclose<Enter>" { "desc" "close current tab, like Vimium" })
+
+; use custom file type
+(require "filetype")
+
+;; Use Paredit
+(vim.api.nvim_create_autocmd
+ "FileType" {"pattern" ["clojure" "fennel" "guile" "scheme" "scheme.guile" "lisp"]
+ "callback" (lambda [] (vim.treesitter.start))})
+
+;; use lazy.nvim plugin manager
+(require "config.lazy")
+
+{:fennel-path "./init.lua"}
+