mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-07 07:09:15 +00:00
ref(nvim): made everything a tiny module
This commit is contained in:
parent
f0fd9699cc
commit
7a5e1537e8
4 changed files with 1 additions and 1 deletions
44
.config/nvim/fnl/opts/init.fnl
Normal file
44
.config/nvim/fnl/opts/init.fnl
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
(import-macros {: set!} :hibiscus.vim)
|
||||
|
||||
(let [opts {;; search
|
||||
:hlsearch false
|
||||
:incsearch true
|
||||
:ignorecase true
|
||||
:smartcase true
|
||||
;; line number
|
||||
:number true
|
||||
:relativenumber true
|
||||
:signcolumn :yes
|
||||
:cursorline true
|
||||
;; spacing
|
||||
:tabstop 4
|
||||
:expandtab true
|
||||
:shiftwidth 4
|
||||
:autoindent true
|
||||
:smartindent true
|
||||
;; line breaking
|
||||
:wrap false
|
||||
:linebreak true
|
||||
:breakindent true
|
||||
;; no ~swp nonsense
|
||||
:filetype :on
|
||||
:swapfile false
|
||||
:backup false
|
||||
:undofile true
|
||||
;; terminal
|
||||
:termguicolors true
|
||||
:mouse :a
|
||||
:scrolloff 3
|
||||
:colorcolumn :80
|
||||
;; folding
|
||||
:foldlevel 99
|
||||
:foldlevelstart 99
|
||||
:foldenable true
|
||||
;; winbar
|
||||
:winbar "%{%v:lua.require'opts.winbar'.eval()%}"
|
||||
:showmode false
|
||||
;; listing
|
||||
:listchars {:tab "│ " :trail "␣"}
|
||||
:list true}]
|
||||
(each [k v (pairs opts)]
|
||||
(set! k v)))
|
||||
19
.config/nvim/fnl/opts/winbar.fnl
Normal file
19
.config/nvim/fnl/opts/winbar.fnl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
(local M {})
|
||||
(local api vim.api)
|
||||
|
||||
(api.nvim_set_hl 0 :WinBar {:fg "#dedede"})
|
||||
(api.nvim_set_hl 0 :WinBarPath {:bg "#dedede"})
|
||||
(api.nvim_set_hl 0 :WinBarModified {:bg "#dedede" :bold true})
|
||||
|
||||
(fn M.eval []
|
||||
(let [buffer (api.nvim_win_get_buf 0)]
|
||||
(var bufname (vim.fn.bufname buffer))
|
||||
(var modified "")
|
||||
(var readonly "")
|
||||
(when (. (. vim.bo buffer) :readonly) (set readonly "[RO] "))
|
||||
(when (. (. vim.bo buffer) :modified) (set modified "[+] "))
|
||||
(set bufname (vim.fn.fnamemodify bufname ":p:~"))
|
||||
(.. "%=" "%#WinBarModified#" readonly modified "%*" "%#WinBarPath#" bufname
|
||||
"%*")))
|
||||
|
||||
M
|
||||
Loading…
Add table
Add a link
Reference in a new issue