more config

This commit is contained in:
elkowar 2021-04-03 21:21:12 +02:00
parent 01158f6a26
commit ed20de4485
6 changed files with 44 additions and 46 deletions

View file

@ -7,9 +7,7 @@
gl plugins.galaxyline
lsp plugins.lsp}
require-macros [macros]})
;include {keybinds keybinds }})
(local colors (utils.colors))
(global pp
(fn [x]
@ -19,6 +17,7 @@
(local colors (utils.colors))
(local bufferline (require "bufferline"))
; :h bufferline-lua-highlights

View file

@ -5,12 +5,13 @@
fennel aniseed.fennel}
require-macros [macros]})
(utils.noremap :n :<leader> ":<c-u>WhichKey '<Space>'<CR>")
(utils.noremap :v :<leader> ":<c-u>WhichKeyVisual '<Space>'<CR>")
(utils.mapexpr :i :<C-Space> "compe#complete()")
(utils.mapexpr :i :<CR> "compe#confirm('<CR>')")
(utils.mapexpr :i :<esc> "compe#complete('<esc>')")
(utils.mapexpr :i :<CR> "compe#confirm(lexima#expand('<LT>CR>', 'i'))")
(utils.mapexpr :i :<esc> "compe#close('<esc>')")
(fn le [s] (.. ":call luaeval(\"" s "\")"))
@ -61,7 +62,12 @@
"n" [":set relativenumber!" "toggle relative numbers"]
"m" [":set nonumber! norelativenumber" "toggle numbers"]
"g" [":Goyo | set linebreak" "toggle focus mode"]
"i" [":IndentGuidesToggle" "toggle indent guides"]}})
"i" [":IndentGuidesToggle" "toggle indent guides"]}
"b" { :name "+buffers"
"b" [":Buffers" "select open buffer"]
"c" [":bdelete!" "close open buffer"]
"w" [":bwipeout!" "wipeout open buffer"]}})
(set nvim.o.timeoutlen 200)

View file

@ -34,20 +34,9 @@
"" { :text "VISUAL BLOCK" :colors { :bg colors.neutral_blue :fg colors.dark0}}})
(fn get-mode-data []
(or (. modes (nvim.fn.mode))
{ :text (nvim.fn.mode)
:colors {:bg colors.neutral_orange :fg colors.dark0}}))
(fn buf-empty? []
(= 1 (nvim.fn.empty (nvim.fn.expand "%:t"))))
(fn checkwidth []
(and (< 35 (/ (nvim.fn.winwidth 0) 2))
(not buf-empty?)))
(fn get-current-file-name []
(let [file (nvim.fn.expand "%:t")]
(if
@ -55,6 +44,16 @@
nvim.bo.readonly (.. "RO " file)
(and nvim.bo.modifiable nvim.bo.modified) (.. file " ")
file)))
(fn get-mode-data []
(or (. modes (nvim.fn.mode))
{ :text (nvim.fn.mode)
:colors {:bg colors.neutral_orange :fg colors.dark0}}))
(fn vim-mode-provider []
(let [modedata (get-mode-data)]
(utils.highlight "GalaxyViMode" modedata.colors)
(.. " " modedata.text " ")))
(utils.highlight "StatusLine" {:bg colors.dark1 :fg colors.light0 })
@ -62,47 +61,38 @@
(set galaxyline.section.left
[ { :ViMode { :provider
(fn []
(let [modedata (get-mode-data)]
(utils.highlight "GalaxyViMode" modedata.colors)
(.. " " modedata.text " "))) }}
[ { :ViMode { :provider vim-mode-provider}}
{ :FileName { :provider get-current-file-name
:highlight [colors.light4 colors.dark1] }}
:highlight [colors.light4 colors.dark1]}}
{ :Space { :provider (fn [] "")
:highlight [colors.light0 colors.dark1] }}])
:highlight [colors.light0 colors.dark1]}}])
(fn provider-lsp-diag [kind]
(fn make-lsp-diagnostic-provider [kind]
(fn []
(let [n (vim.lsp.diagnostic.get_count 0 kind)]
(if
(= n 0) ""
(.. " " n " ")))))
(if (= n 0) "" (.. " " n " ")))))
(fn git-branch-provider []
(let [branch (gl-vcs.get_git_branch)]
(if (= "master" branch) "" branch)))
(set galaxyline.section.right
[ { :GitBranch { :provider (fn []
(let [branch (gl-vcs.get_git_branch)]
(if (= "master" branch) "" branch)))
:highlight [colors.light4 colors.dark1] }}
[ { :GitBranch { :provider git-branch-provider
:highlight [colors.light4 colors.dark1]}}
{ :FileType { :provider (fn [] nvim.bo.filetype)
:highlight [colors.neutral_aqua colors.dark1] }}
:highlight [colors.neutral_aqua colors.dark1]}}
{ :DiagnosticInfo { :provider (provider-lsp-diag "Info")
:highlight [colors.dark1 colors.neutral_blue] }}
{ :DiagnosticWarn { :provider (provider-lsp-diag "Warning")
{ :DiagnosticInfo { :provider (make-lsp-diagnostic-provider "Info")
:highlight [colors.dark1 colors.neutral_blue]}}
{ :DiagnosticWarn { :provider (make-lsp-diagnostic-provider "Warning")
:highlight [colors.dark1 colors.neutral_yellow]
:separator "" }}
{ :DiagnosticError { :provider (provider-lsp-diag "Error")
:separator ""}}
{ :DiagnosticError { :provider (make-lsp-diagnostic-provider "Error")
:highlight [colors.dark1 colors.bright_red]
:separator "" }}
:separator ""}}
{ :LineInfo { :provider (fn [] (.. " " (gl-fileinfo.line_column) " "))
:highlight "GalaxyViMode"
:separator "" }}])
:separator ""}}])
(do
(fn add-segment-defaults [data]

View file

@ -54,7 +54,7 @@
:calc true
:nvim_lsp true
:nvim_lua true
:vsnip false }})
:vsnip false}})
(saga.init_lsp_saga

View file

@ -356,6 +356,9 @@ source $VIM_ROOT/whichkeyConfig.vim
let g:aniseed#env = v:true
let g:lexima_no_default_rules = v:true
call lexima#set_default_rules()
"inoremap <silent><expr> <C-Space> compe#complete()
"inoremap <silent><expr> <CR> compe#confirm('<CR>')
"inoremap <silent><expr> <esc> compe#close('<esc>')

View file

@ -138,7 +138,7 @@ call plug#begin('~/.vim/plugged')
Plug 'bakpakin/fennel.vim'
Plug 'tjdevries/nlua.nvim'
Plug 'nvim-lua/completion-nvim'
"Plug 'nvim-lua/completion-nvim'
"Plug 'mxw/vim-prolog'