-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsettings.fnl
264 lines (200 loc) · 7.14 KB
/
settings.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
;;; GLOBALS ;;;;
(tset _G :HOME_PATH (vim.fn.expand "$HOME"))
(tset _G :CONFIG_PATH (vim.fn.stdpath "config"))
(tset _G :DATA_PATH (vim.fn.stdpath "data"))
(tset _G :CACHE_PATH (vim.fn.stdpath "cache"))
(tset _G :TERMINAL (vim.fn.expand "$TERMINAL"))
;;; SETTINGS ;;
;;; Set leaders
(tset vim.g :mapleader " ")
(tset vim.g :maplocalleader " ")
;;; Set terminal title to TERMINAL after exit
(tset vim.opt :titleold _G.TERMINAL)
;;; Don't show incremental :s results in a split
(tset vim.opt :inccommand :nosplit)
;;; Lispy keywords
(doto vim.opt.iskeyword
(: :append "-")
(: :remove ":"))
;;; Keys, with which you can wrap around lines
(doto vim.opt.whichwrap
(: :append "<")
(: :append ">")
(: :append "[")
(: :append "]")
(: :append "h")
(: :append "l"))
;;; Whitespace visualization
(tset vim.opt :list true)
(tset vim.opt :listchars
{;; :space "␣"
:nbsp "␣"
:trail ""
;; :eol "↴"
:tab ""})
;;; Old whitespace visualization
;; (vim.cmd "highlight ExtraWhitespace ctermbg=red guibg=red")
;; (vim.cmd "match ExtraWhitespace /\\s\\+$/")
;; (vim.cmd "autocmd Syntax * syn match ExtraWhitespace /\\s\\+$\\| \+\\ze\\t/")
;;; Don't create backup files
(tset vim.opt :backup false)
;;; Don't break in the middle of words
(tset vim.opt :breakat " \t;:,])}")
;;; Indent wrapped lines
(tset vim.opt :breakindent true)
;;; Options for breakindent
(tset vim.opt :breakindentopt ["shift:0"
"list:0"
"min:40"
"sbr"])
;;; String to show when wrapping a line
(tset vim.opt :showbreak "☇") ;; "↪" ">>"
;;; Allows neovim to access the system clipboard
(tset vim.opt :clipboard "unnamedplus")
;;; More space in the neovim command line for displaying messages
(tset vim.opt :cmdheight 1)
;;; Visual reminder for 80 char line limit
;; (tset vim.opt :colorcolumn "80")
;;; Conceal the current line only when in command mode
(tset vim.opt :concealcursor "c")
;;; Completely hidden conceals
(tset vim.opt :conceallevel 2)
;;; Highlight the current column
;; (tset vim.opt :cursorcolumn true)
;;; Highlight the current line
(tset vim.opt :cursorline true)
;;; Highlight currect line number
(tset vim.opt :cursorlineopt "number")
;;; Convert tabs to spaces
(tset vim.opt :expandtab true)
;;; The encoding written to a file
(tset vim.opt :fileencoding "utf-8")
;;; The font used in graphical neovim applications
(tset vim.opt :guifont "FiraCode Nerd Font:h17")
;;; Required to keep multiple buffers and open multiple buffers
(tset vim.opt :hidden true)
;;; Highlight all matches on previous search pattern
(tset vim.opt :hlsearch true)
;;; Ignore case in search patterns
(tset vim.opt :ignorecase true)
;;; Make cyrillic work in NORMAL mode (mostly)
;; TODO: automate?
(tset vim.opt :langmap
[;; Cyrillic to Latin mappings for Bulgarian Phonetic Traditional
;; Lowercase mappings
"аa" "бb" "вw" "гg" "дd" "еe" "жv" "зz" "иi" "йj" "кk" "лl" "мm" "нn"
"оo" "пp" "рr" "сs" "тt" "уu" "фf" "хh" "цc" "ч`" "ш[" "щ]" "ъy" "ьx" "ю\\" "яq"
;; Uppercase mappings
"АA" "БB" "ВW" "ГG" "ДD" "ЕE" "ЖV" "ЗZ" "ИI" "ЙJ" "КK" "ЛL" "МM" "НN"
"ОO" "ПP" "РR" "СS" "ТT" "УU" "ФF" "ХH" "ЦC" "Ч~" "Ш{" "Щ}" "ЪY" "ЬX" "Ю|" "ЯQ"])
;;; Global statusline
(tset vim.opt :laststatus 3)
;;; Allow the mouse to be used in neovim
(tset vim.opt :mouse "a")
;;; Set numbered lines
(tset vim.opt :number true)
;;; Winblend for the autocompletion window
(tset vim.opt :pumblend 20)
;;; Pop up menu height
(tset vim.opt :pumheight 10)
;;; Set relatively numbered lines
(tset vim.opt :relativenumber true)
;;; Always keep the cursor 3 lines away from the edge
(tset vim.opt :scrolloff 3)
;;; The number of spaces inserted for each indentation
(tset vim.opt :shiftwidth 4)
;;; Configure shorter statusline indicators
(doto vim.opt.shortmess
;;; Hide "Pattern not found" when no completion is available
(: :append "c")
;;; Ensure autocmd works for Filetype
(: :remove "F")
;;; Hide "written" when writing a file
(: :append "W"))
;;; we don't need to see things like -- INSERT -- anymore
(tset vim.opt :showmode false)
;;; Always show tabline
(tset vim.opt :showtabline 2)
;;; Always show the sign column, otherwise it would shift the text each time
(tset vim.opt :signcolumn "auto:3")
;;; Smart case
(tset vim.opt :smartcase true)
;;; Make indenting smarter again
;;; NOTE: messes with treesitter
(tset vim.opt :smartindent false)
;;; More tab is 4 spaces config
(tset vim.opt :softtabstop 4)
;;; Force all horizontal splits to go below current window
(tset vim.opt :splitbelow true)
;;; Keep the same screen lines in all windows after splitting
(tset vim.opt :splitkeep "screen")
;;; Force all vertical splits to go to the right of current window
(tset vim.opt :splitright true)
;;; Creates a swapfile
(tset vim.opt :swapfile false)
;;; Insert 4 spaces for a tab
(tset vim.opt :tabstop 4)
;;; Set term gui colors (most terminals support this)
(tset vim.opt :termguicolors true)
;;; Time to wait for a mapped sequence to complete (in milliseconds)
(tset vim.opt :timeoutlen 300)
;;; Set the title of window to the value of the titlestring
(tset vim.opt :title true)
;;; What the title of the window will be set to)
(tset vim.opt :titlestring "%<%F%=%l/%L) ; nvim")
;;; Set an undo directory
(tset vim.opt :undodir (.. _G.CACHE_PATH "/undo"))
;;; Enable persistent undo
(tset vim.opt :undofile true)
;;; Faster completion
(tset vim.opt :updatetime 300)
;;; Winblend for floating windows
(tset vim.opt :winblend 20)
;;; Display lines as one long line
(tset vim.opt :wrap true)
;;; Display lines as one long line
(tset vim.opt :wrap true)
;;; If a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
(tset vim.opt :writebackup false)
;; (tset vim.wo :fillchars "fold: ")
(tset vim.wo :foldexpr "nvim_treesitter#foldexpr()")
;; (tset vim.wo :foldtext "nvim_treesitter#foldtext()")
(tset vim.wo :foldmethod "expr")
;; (tset vim.wo :foldminlines 1)
;; (tset vim.wo :foldnestmax 3)
;; (tset vim.wo :foldtext "substitute(getline(v:foldstart),'\\t',repeat('\\ ',&tabstop),'g').'...'.trim(getline(v:foldend))")
(tset vim.opt :foldcolumn :0)
(tset vim.opt :foldlevel 99)
(tset vim.opt :foldlevelstart 99)
(tset vim.opt :foldenable true)
;;; Disable builtin plugins and language providers
(let [disabled-plugins
["2html_plugin"
"getscript"
"getscriptPlugin"
"gzip"
"logipat"
"netrw"
"netrwPlugin"
"netrwSettings"
"netrwFileHandlers"
"matchit"
"matchparen"
"spec"
"tar"
"tarPlugin"
"rrhelper"
"spellfile_plugin"
"vimball"
"vimballPlugin"
"zip"
"zipPlugin"]
disabled-providers
["node_provider"
"perl_provider"
"python3_provider"
"ruby_provider"]]
(each [_ plugin (ipairs disabled-plugins)]
(tset vim.g (.. "loaded_" plugin) 1))
(each [_ provider (ipairs disabled-providers)]
(tset vim.g (.. "loaded_" provider) 0)))