misc cleanup/fixes, adding conceals

This commit is contained in:
Proctor
2021-08-24 16:18:52 -05:00
parent ce141a383a
commit 6417778052
10 changed files with 67 additions and 51 deletions

View 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()"))

View File

@@ -8,6 +8,7 @@
(require :dotfiles.plugins) (require :dotfiles.plugins)
(require :dotfiles.core) (require :dotfiles.core)
(require :dotfiles.mapping) (require :dotfiles.mapping)
(require :dotfiles.conceal)
;(nvim.ex.source "~/.vimrc") ;(nvim.ex.source "~/.vimrc")

View File

@@ -52,8 +52,5 @@
(noremap :n :gph ":GitGutterPrevHunk<CR>") (noremap :n :gph ":GitGutterPrevHunk<CR>")
(noremap :n :gsh ":GitGutterStageHunk<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) ; Open file in Marked 2 (markdown viewer)
(noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app \'%:p\'<cr>") (noremap :n :<leader>mv ":AsyncRun -mode=bang open -a Marked\\ 2.app \'%:p\'<cr>")

View File

@@ -21,6 +21,7 @@
:source {:path true :source {:path true
:buffer true :buffer true
:calc true :calc true
:emoji true
:nvim_lsp true :nvim_lsp true
:nvim_lua true :nvim_lua true
:conjure true :conjure true

View File

@@ -5,15 +5,3 @@
; (set nvim.g.conjure#log#botright true) ; (set nvim.g.conjure#log#botright true)
; (set nvim.g.conjure#mapping#doc_word "gk") ; (set nvim.g.conjure#mapping#doc_word "gk")
(set nvim.g.conjure#extract#tree_sitter#enabled true) (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'),
; \ }))

View File

@@ -3,5 +3,3 @@
util dotfiles.util }}) util dotfiles.util }})
(util.noremap :v :<leader><bslash> "EasyAlign*<Bar>") (util.noremap :v :<leader><bslash> "EasyAlign*<Bar>")
;;(nvim.ex.autocmd :BufWritePre :<buffer> :lua "vim.lsp.buf.formatting_sync()")

View File

@@ -47,11 +47,11 @@
(def client-nmappings (def client-nmappings
{:clojure {:clojure
{ {
:<leader>cn "lua LspExecuteCommand('clean-ns')" :<leader>cn "call LspExecuteCommand('clean-ns')"
:<leader>ref "lua LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')" :<leader>ref "call LspExecuteCommand('extract-function', vim.api.nvim_eval(\"input('Function name: ')\")')"
:<leader>id "lua LspExecuteCommand('inline-symbol')" :<leader>id "call LspExecuteCommand('inline-symbol')"
:<leader>il "lua LspExecuteCommand('introduce-let', vim.api.nvim_eval(\"input('Binding name: ')\")')" :<leader>il "call 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>m2l "call LspExecuteCommand('move-to-let', vim.api.nvim_eval(\"input('Binding name: ')\")')"
} }
}) })

View File

@@ -6,4 +6,3 @@
(u.nnoremap :<leader>pi :PackerInstall) (u.nnoremap :<leader>pi :PackerInstall)
(u.nnoremap :<leader>pu :PackerUpdate) (u.nnoremap :<leader>pu :PackerUpdate)

View File

@@ -68,17 +68,6 @@
(use packages) (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('dense-analysis/ale') " Linting
;; call minpac#add('editorconfig/editorconfig-vim') ;; call minpac#add('editorconfig/editorconfig-vim')

View File

@@ -22,20 +22,3 @@ vim.g["aniseed#env"] = {
module = "dotfiles.init", module = "dotfiles.init",
compile = true 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,
-- -- -- },
-- -- }
-- --
-- --
-- --