-
Notifications
You must be signed in to change notification settings - Fork 14
/
lualine.fnl
54 lines (49 loc) · 2.2 KB
/
lualine.fnl
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(local {: autoload} (require :nfnl.module))
(local lsp (autoload :config.lsp))
(fn lsp_connection []
(let [message (lsp.get-progress-message)]
(if
; if has progress handler and is loading
(or (= message.status "begin")
(= message.status "report"))
(.. message.msg " : " message.percent "%% ")
; if has progress handler and finished loading
(= message.status "end")
""
; if hasn't progress handler, but has connected lsp client
(and (= message.status "")
(not (vim.tbl_isempty (vim.lsp.buf_get_clients 0))))
""
; else
"")))
[{1 :nvim-lualine/lualine.nvim
:config (fn []
(let [lualine (require :lualine)]
(lualine.setup
{:options {:theme "tokyonight"
:icons_enabled true
:section_separators ["" ""]
:component_separators ["" ""]}
:sections {:lualine_a []
:lualine_b [[:mode {:upper true}]]
:lualine_c [["FugitiveHead"]
{1 :filename
:file_status true
:path 1
:shorting_target 40}]
:lualine_x [{1 :diagnostics
:sections [:error :warn :info :hint]
:sources [:nvim_lsp]}
[lsp_connection]
:location
:filetype]
:lualine_y [:encoding]
:lualine_z []}
:inactive_sections {:lualine_a []
:lualine_b []
:lualine_c [{1 :filename
:file_status true
:path 1}]
:lualine_x []
:lualine_y []
:lualine_z []}})))}]