From 487d7d06cc40f3e60a884693811f5fbb8a980040 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 6 Jan 2024 00:00:28 +0100 Subject: Move utils to settings --- fnl/icons.fnl | 45 --------------------------------------------- fnl/settings/cursorline.fnl | 27 +++++++++++++++++++++++++++ fnl/settings/icons.fnl | 45 +++++++++++++++++++++++++++++++++++++++++++++ fnl/util/cursorline.fnl | 27 --------------------------- 4 files changed, 72 insertions(+), 72 deletions(-) delete mode 100644 fnl/icons.fnl create mode 100644 fnl/settings/cursorline.fnl create mode 100644 fnl/settings/icons.fnl delete mode 100644 fnl/util/cursorline.fnl diff --git a/fnl/icons.fnl b/fnl/icons.fnl deleted file mode 100644 index b1115cb..0000000 --- a/fnl/icons.fnl +++ /dev/null @@ -1,45 +0,0 @@ -;; Icons. - -{:error "" - :warn "" - :hint "" - :info "" - :git " " - :search-project "󰺅" - :search-files "󰱽" - :search-text "󱎸" - :notebook "" - :recent-files "󱋢" - :cog "" - :org "" - :checkmark "" - :right-arrow "" - :small-right-arrow "" - :guillemet "»" - :close "" - :git-add "|" - :git-delete "_" - :git-top-delete "‾" - :git-change-delete "~" - :git-untracked "┆" - :telescope "" - :caret ">" - :cmd "" - :lightning "" - :document "" - :import "" - :keyboard "" - :sleep "󰒲" - :filled-orb "●" - :orb "○" - :package "󰏗" - :vim "" - :code "" - :play "" - :star "" - :line "‒" - :ignored "" - :unstaged "" - :staged "" - :conflict "" -} diff --git a/fnl/settings/cursorline.fnl b/fnl/settings/cursorline.fnl new file mode 100644 index 0000000..cec76f2 --- /dev/null +++ b/fnl/settings/cursorline.fnl @@ -0,0 +1,27 @@ +;; Shows (hides) the cursorline in the (un)focused window. + +(local ignored [:neo-tree]) + +(fn filetype [] + vim.bo.filetype) + +(fn ignore [] + (vim.tbl_contains ignored (filetype))) + +(fn show [] + (let [(ok cl) (pcall vim.api.nvim_win_get_var 0 :auto-cursorline)] + (if (and ok cl) + (do + (set vim.wo.cursorline true) + (vim.api.nvim_win_del_var 0 :auto-cursorline))))) + +(fn hide [] + (if (not= (ignore) true) + (do + (let [cl vim.wo.cursorline] + (if cl + (do + (vim.api.nvim_win_set_var 0 :auto-cursorline cl) + (set vim.wo.cursorline false))))))) + +{: show : hide} diff --git a/fnl/settings/icons.fnl b/fnl/settings/icons.fnl new file mode 100644 index 0000000..b1115cb --- /dev/null +++ b/fnl/settings/icons.fnl @@ -0,0 +1,45 @@ +;; Icons. + +{:error "" + :warn "" + :hint "" + :info "" + :git " " + :search-project "󰺅" + :search-files "󰱽" + :search-text "󱎸" + :notebook "" + :recent-files "󱋢" + :cog "" + :org "" + :checkmark "" + :right-arrow "" + :small-right-arrow "" + :guillemet "»" + :close "" + :git-add "|" + :git-delete "_" + :git-top-delete "‾" + :git-change-delete "~" + :git-untracked "┆" + :telescope "" + :caret ">" + :cmd "" + :lightning "" + :document "" + :import "" + :keyboard "" + :sleep "󰒲" + :filled-orb "●" + :orb "○" + :package "󰏗" + :vim "" + :code "" + :play "" + :star "" + :line "‒" + :ignored "" + :unstaged "" + :staged "" + :conflict "" +} diff --git a/fnl/util/cursorline.fnl b/fnl/util/cursorline.fnl deleted file mode 100644 index cec76f2..0000000 --- a/fnl/util/cursorline.fnl +++ /dev/null @@ -1,27 +0,0 @@ -;; Shows (hides) the cursorline in the (un)focused window. - -(local ignored [:neo-tree]) - -(fn filetype [] - vim.bo.filetype) - -(fn ignore [] - (vim.tbl_contains ignored (filetype))) - -(fn show [] - (let [(ok cl) (pcall vim.api.nvim_win_get_var 0 :auto-cursorline)] - (if (and ok cl) - (do - (set vim.wo.cursorline true) - (vim.api.nvim_win_del_var 0 :auto-cursorline))))) - -(fn hide [] - (if (not= (ignore) true) - (do - (let [cl vim.wo.cursorline] - (if cl - (do - (vim.api.nvim_win_set_var 0 :auto-cursorline cl) - (set vim.wo.cursorline false))))))) - -{: show : hide} -- cgit v1.2.3-70-g09d2