summaryrefslogtreecommitdiff
path: root/fnl/settings/cursorline.fnl
blob: 7b7eae1702a1a5c78425b074901db3b09ab9d100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;; Shows (hides) the cursorline in the (un)focused window.

(local ignored [:neo-tree])

(λ filetype []
  vim.bo.filetype)

(λ ignore []
  (vim.tbl_contains ignored (filetype)))

(λ 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)))))

(λ 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}