diff --git a/nvim/.config/nvim/fnl/dotfiles/conceal.fnl b/nvim/.config/nvim/fnl/dotfiles/conceal.fnl new file mode 100644 index 0000000..a028590 --- /dev/null +++ b/nvim/.config/nvim/fnl/dotfiles/conceal.fnl @@ -0,0 +1,60 @@ +(module dotfiles.conceal + {autoload {nvim aniseed.nvim + nu aniseed.nvim.util + u dotfiles.util}}) + + +(def conceals {:defn :𝑓 + :fn :λ + :lambda :λ + :and :∧ + :&& :∧ + :or :∨ + :|| :∨ + :not :¬ + :! :¬ + :for :∀ + :in :∈ + ; "\\ \\" :∉ + :true :⊤ + :false :⊥ +;; and +;; or +;; (not +;; None | ∅ +;; true, false | ⊤, ⊥ (top and bottom from logic) +;; +;; for | ∀ +;; in | ∈ +;; not in | ∉ + }) + + +(defn setup-conceals [] + (nvim.fn.clearmatches) + (each [the-match replacement (pairs conceals)] + (let [the-match (.. "\\<" the-match "\\>" )] + (nvim.fn.matchadd :Conceal the-match 0 -1 {:conceal replacement}))) + + (set nvim.wo.concealcursor :nvc) + (set nvim.wo.conceallevel 2)) + + +(defn toggle-conceal [] + ( if (= 0 nvim.wo.conceallevel) + (set nvim.wo.conceallevel 2) + (set nvim.wo.conceallevel 0))) + +;(if true true false) + + +(nu.fn-bridge :ToggleConceal :dotfiles.conceal :toggle-conceal {:return false}) +(nu.fn-bridge :SetupConceals :dotfiles.conceal :setup-conceals {:return false}) +(u.nnoremap :ct "call ToggleConceal()") + +(def pretty-filetypes [:fennel + :clojure]) + +(each [_ ftype (pairs pretty-filetypes)] + (nvim.ex.autocmd :FileType ftype :call "SetupConceals()")) + diff --git a/nvim/.config/nvim/fnl/dotfiles/init.fnl b/nvim/.config/nvim/fnl/dotfiles/init.fnl index d82beef..f020922 100644 --- a/nvim/.config/nvim/fnl/dotfiles/init.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/init.fnl @@ -8,6 +8,7 @@ (require :dotfiles.plugins) (require :dotfiles.core) (require :dotfiles.mapping) +(require :dotfiles.conceal) ;(nvim.ex.source "~/.vimrc") diff --git a/nvim/.config/nvim/fnl/dotfiles/mapping.fnl b/nvim/.config/nvim/fnl/dotfiles/mapping.fnl index e9655fe..7730b32 100644 --- a/nvim/.config/nvim/fnl/dotfiles/mapping.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/mapping.fnl @@ -52,8 +52,5 @@ (noremap :n :gph ":GitGutterPrevHunk") (noremap :n :gsh ":GitGutterStageHunk") -; (noremap :n :li "LspInfo") -;vim.api.nvim_set_keymap('n', 'li', 'LspInfo', { noremap=true, silent=true }) - ; Open file in Marked 2 (markdown viewer) (noremap :n :mv ":AsyncRun -mode=bang open -a Marked\\ 2.app \'%:p\'") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl index 338f1b8..5d3734a 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/compe.fnl @@ -21,6 +21,7 @@ :source {:path true :buffer true :calc true + :emoji true :nvim_lsp true :nvim_lua true :conjure true diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl index 4a478fc..d12475d 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/conjure.fnl @@ -5,15 +5,3 @@ ; (set nvim.g.conjure#log#botright true) ; (set nvim.g.conjure#mapping#doc_word "gk") (set nvim.g.conjure#extract#tree_sitter#enabled true) - -; (n - -; -; -; au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#conjure#get_source_options({ -; \ 'name': 'conjure', -; \ 'allowlist': ['clojure', 'fennel'], -; \ 'triggers': {'*': ['/']}, -; \ 'time': 20, -; \ 'completor': function('asyncomplete#sources#conjure#completor'), -; \ })) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl index d1062f5..b8dc5a6 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/easyalign.fnl @@ -3,5 +3,3 @@ util dotfiles.util }}) (util.noremap :v : "EasyAlign*") - -;;(nvim.ex.autocmd :BufWritePre : :lua "vim.lsp.buf.formatting_sync()") diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl index ad55b3a..6e867c1 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl @@ -47,11 +47,11 @@ (def client-nmappings {:clojure { - :cn "lua LspExecuteCommand('clean-ns')" - :ref "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')" - :id "lua LspExecuteCommand('inline-symbol')" - :il "lua LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')" - :m2l "lua LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')" + :cn "call LspExecuteCommand('clean-ns')" + :ref "call LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')" + :id "call LspExecuteCommand('inline-symbol')" + :il "call LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')" + :m2l "call LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')" } }) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl index 1f1efb4..b5946ed 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/packer.fnl @@ -6,4 +6,3 @@ (u.nnoremap :pi :PackerInstall) (u.nnoremap :pu :PackerUpdate) - diff --git a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl index e8c137b..602a379 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugins.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugins.fnl @@ -68,17 +68,6 @@ (use packages) -;;(nu.fn-bridge -;; :DeleteHiddenBuffers -;; :dotfiles.mapping :delete-hidden-buffers) - -; " Define user commands for updating/cleaning the plugins. -; " Each of them loads minpac, reloads .vimrc to register the -; information of plugins, then performs the task. -; command! PackUpdate call PackInit() | call minpac#update('', {'do': 'call minpac#status()'}) -; command! PackClean call PackInit() | call minpac#clean() -; command! PackStatus packadd minpac | call minpac#status() - ;; call minpac#add('dense-analysis/ale') " Linting ;; call minpac#add('editorconfig/editorconfig-vim') diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index a21e4aa..7d9af5f 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -22,20 +22,3 @@ vim.g["aniseed#env"] = { module = "dotfiles.init", compile = true } - --- -- require'nvim-treesitter.configs'.setup { --- -- ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages --- -- -- ignore_install = { "javascript" }, -- List of parsers to ignore installing --- -- -- highlight = { --- -- -- enable = true, -- false will disable the whole extension --- -- -- disable = { "c", "rust" }, -- list of language that will be disabled --- -- -- -- Setting this to true will run `:h syntax` and tree-sitter at the same time. --- -- -- -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). --- -- -- -- Using this option may slow down your editor, and you may see some duplicate highlights. --- -- -- -- Instead of true it can also be a list of languages --- -- -- additional_vim_regex_highlighting = false, --- -- -- }, --- -- } --- -- --- -- --- --