mirror of
https://github.com/stevenproctor/dotfiles.git
synced 2026-01-28 17:29:54 -06:00
misc cleanup/fixes, adding conceals
This commit is contained in:
60
nvim/.config/nvim/fnl/dotfiles/conceal.fnl
Normal file
60
nvim/.config/nvim/fnl/dotfiles/conceal.fnl
Normal file
@@ -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 :∈
|
||||
; "\\<not\\> \\<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 :<leader>ct "call ToggleConceal()")
|
||||
|
||||
(def pretty-filetypes [:fennel
|
||||
:clojure])
|
||||
|
||||
(each [_ ftype (pairs pretty-filetypes)]
|
||||
(nvim.ex.autocmd :FileType ftype :call "SetupConceals()"))
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
(require :dotfiles.plugins)
|
||||
(require :dotfiles.core)
|
||||
(require :dotfiles.mapping)
|
||||
(require :dotfiles.conceal)
|
||||
|
||||
;(nvim.ex.source "~/.vimrc")
|
||||
|
||||
|
||||
@@ -52,8 +52,5 @@
|
||||
(noremap :n :gph ":GitGutterPrevHunk<CR>")
|
||||
(noremap :n :gsh ":GitGutterStageHunk<CR>")
|
||||
|
||||
; (noremap :n :<leader>li "<Cmd>LspInfo<CR>")
|
||||
;vim.api.nvim_set_keymap('n', '<leader>li', '<Cmd>LspInfo<CR>', { noremap=true, silent=true })
|
||||
|
||||
; Open file in Marked 2 (markdown viewer)
|
||||
(noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app \'%:p\'<cr>")
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
:source {:path true
|
||||
:buffer true
|
||||
:calc true
|
||||
:emoji true
|
||||
:nvim_lsp true
|
||||
:nvim_lua true
|
||||
:conjure true
|
||||
|
||||
@@ -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'),
|
||||
; \ }))
|
||||
|
||||
@@ -3,5 +3,3 @@
|
||||
util dotfiles.util }})
|
||||
|
||||
(util.noremap :v :<leader><bslash> "EasyAlign*<Bar>")
|
||||
|
||||
;;(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
(def client-nmappings
|
||||
{:clojure
|
||||
{
|
||||
:<leader>cn "lua LspExecuteCommand('clean-ns')"
|
||||
:<leader>ref "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')"
|
||||
:<leader>id "lua LspExecuteCommand('inline-symbol')"
|
||||
:<leader>il "lua LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
|
||||
:<leader>m2l "lua LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
|
||||
:<leader>cn "call LspExecuteCommand('clean-ns')"
|
||||
:<leader>ref "call LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')"
|
||||
:<leader>id "call LspExecuteCommand('inline-symbol')"
|
||||
:<leader>il "call LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
|
||||
:<leader>m2l "call LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@
|
||||
|
||||
(u.nnoremap :<leader>pi :PackerInstall)
|
||||
(u.nnoremap :<leader>pu :PackerUpdate)
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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,
|
||||
-- -- -- },
|
||||
-- -- }
|
||||
-- --
|
||||
-- --
|
||||
-- --
|
||||
|
||||
Reference in New Issue
Block a user