summaryrefslogtreecommitdiff
path: root/fnl
diff options
context:
space:
mode:
authorMike Vink <>2023-03-16 09:14:29 +0100
committerMike Vink <>2023-03-16 09:14:29 +0100
commit4361670912463016c2435c6b8828d7aa7b637816 (patch)
tree3c0ac0ece825a91fcadd33544faac2573cdfbb12 /fnl
parent5c2086b3fee16a7781b167f909e59b286ae30fee (diff)
gitsigns and heirline
Diffstat (limited to 'fnl')
-rw-r--r--fnl/conf/init.fnl2
-rw-r--r--fnl/conf/pkgs.fnl1
-rw-r--r--fnl/conf/pkgs/cmp.fnl31
-rw-r--r--fnl/conf/pkgs/gitsigns.fnl2
-rw-r--r--fnl/conf/pkgs/heirline.fnl6
5 files changed, 37 insertions, 5 deletions
diff --git a/fnl/conf/init.fnl b/fnl/conf/init.fnl
index c56aaa7..93e26cf 100644
--- a/fnl/conf/init.fnl
+++ b/fnl/conf/init.fnl
@@ -1,4 +1,4 @@
-(vim.cmd "colorscheme gruvbox-material")
+(vim.cmd "colorscheme kanagawa-wave")
(vim.cmd "filetype plugin on")
(vim.cmd "filetype indent on")
(vim.cmd "highlight WinSeparator guibg=None")
diff --git a/fnl/conf/pkgs.fnl b/fnl/conf/pkgs.fnl
index ee53f47..119e8b8 100644
--- a/fnl/conf/pkgs.fnl
+++ b/fnl/conf/pkgs.fnl
@@ -8,3 +8,4 @@
(require :conf.pkgs.trouble)
(require :conf.pkgs.lsp_lines)
(require :conf.pkgs.dap)
+(require :conf.pkgs.heirline)
diff --git a/fnl/conf/pkgs/cmp.fnl b/fnl/conf/pkgs/cmp.fnl
index 461aba1..244ac3f 100644
--- a/fnl/conf/pkgs/cmp.fnl
+++ b/fnl/conf/pkgs/cmp.fnl
@@ -1,13 +1,36 @@
+(fn has-words-before []
+ (local [line col] (vim.api.nvim_win_get_cursor 0))
+ (local [word & rest] (vim.api.nvim_buf_get_lines 0 (- line 1) line true))
+ (local before (word:sub col col))
+ (local is_string (before:match "%s"))
+ (and (not= col 0) (= is_string nil)))
+
(fn cmp-setup [cmp autocomplete]
(let [luasnip (require :luasnip)
snip (fn [args]
(luasnip.lsp_expand (. args :body)))]
(local cfg
{:snippet {:expand snip}
- :mapping (cmp.mapping.preset.insert {:<C-b> (cmp.mapping.scroll_docs -4)
- :<C-f> (cmp.mapping.scroll_docs 4)
- :<C-A> (cmp.mapping.complete)
- :<C-e> (cmp.mapping.confirm {:select true})})
+ :mapping {:<Tab> (cmp.mapping (fn [fallback]
+ (if (cmp.visible)
+ (cmp.select_next_item)
+ (luasnip.expand_or_jumpable)
+ (luasnip.expand_or_jump)
+ (has-words-before)
+ (cmp.complete)
+ (fallback))
+ [:i :s]))
+ :<S-Tab> (cmp.mapping (fn [fallback]
+ (if (cmp.visible)
+ (cmp.select_prev_item)
+ (luasnip.jumpable -1)
+ (luasnip.jump -1)
+ (fallback))
+ [:i :s]))
+ :<C-b> (cmp.mapping.scroll_docs -4)
+ :<C-f> (cmp.mapping.scroll_docs 4)
+ :<C-A> (cmp.mapping.complete)
+ :<C-y> (cmp.mapping.confirm {:select true})}
:sources (cmp.config.sources [{:name :conjure}
{:name :nvim_lsp}
{:name :path}
diff --git a/fnl/conf/pkgs/gitsigns.fnl b/fnl/conf/pkgs/gitsigns.fnl
new file mode 100644
index 0000000..813d410
--- /dev/null
+++ b/fnl/conf/pkgs/gitsigns.fnl
@@ -0,0 +1,2 @@
+(local gitsigns (require :gitsigns))
+(gitsigns.setup)
diff --git a/fnl/conf/pkgs/heirline.fnl b/fnl/conf/pkgs/heirline.fnl
new file mode 100644
index 0000000..a40cd7c
--- /dev/null
+++ b/fnl/conf/pkgs/heirline.fnl
@@ -0,0 +1,6 @@
+(local heirline (require :heirline))
+(local colors (let [kanagawa-colors (require :kanagawa.colors)] (kanagawa-colors.setup)))
+(print (vim.inspect heirline))
+(print (vim.inspect colors))
+
+(heirline.load_colors colors)