From e9cdccb8a8d3a5e3ca0eebc3193735c0fa00ca49 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Fri, 24 Sep 2021 01:12:21 +0700 Subject: [PATCH] Another bunch of changes emacs: update init.el following upstream neovim: add conjure, update packer call for nvim-cmp --- home/.config/doom/init.el | 9 +-- home/.config/nvim/lua/modules/completion.lua | 1 + home/.config/nvim/lua/modules/editor.lua | 5 ++ home/.config/nvim/lua/modules/tools.lua | 4 ++ home/.config/nvim/lua/options.lua | 1 + home/.config/nvim/lua/plugins.lua | 67 +++++++++----------- 6 files changed, 47 insertions(+), 40 deletions(-) diff --git a/home/.config/doom/init.el b/home/.config/doom/init.el index 557f89d..8ab763a 100644 --- a/home/.config/doom/init.el +++ b/home/.config/doom/init.el @@ -29,6 +29,7 @@ +prescient ;;+childframe +icons) + ;;vertico ; the search engine of the future :ui ;;deft ; notational velocity for Emacs @@ -39,7 +40,6 @@ +unicode +ascii +github) - ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra indent-guides ; highlighted indent columns @@ -71,7 +71,7 @@ ;;lispy ; vim for lisp, for people who don't like vim multiple-cursors ; editing in many places at once ;;objed ; text object editing for the innocent - ;;parinfer ; turn lisp into python, sort of + ;;(parinfer +rust) ; turn lisp into python, sort of ;;rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to ;;word-wrap ; soft wrapping with language-aware indent @@ -139,6 +139,7 @@ ;;csharp ; unity, .NET, and mono shenanigans data ; config/data formats ;;(dart +flutter) ; paint ui and not much else + ;;dhall ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? emacs-lisp ; drown in parentheses @@ -163,8 +164,8 @@ +cdlatex +lsp +fold) - ;;lean - ;;ledger ; an accounting system in Emacs + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be (lua ; one-based indices? one-based indices +moonscript +lsp) diff --git a/home/.config/nvim/lua/modules/completion.lua b/home/.config/nvim/lua/modules/completion.lua index 35a6eb1..aae96ed 100644 --- a/home/.config/nvim/lua/modules/completion.lua +++ b/home/.config/nvim/lua/modules/completion.lua @@ -115,6 +115,7 @@ function M.cmp_conf() {name = 'spell'}, {name = 'emoji'}, {name = 'nvim_lsp'}, + {name = 'conjure'}, {name = 'latex_symbols'}, {name = 'tmux'}, {name = 'orgmode'} diff --git a/home/.config/nvim/lua/modules/editor.lua b/home/.config/nvim/lua/modules/editor.lua index 07c599b..8cd504c 100644 --- a/home/.config/nvim/lua/modules/editor.lua +++ b/home/.config/nvim/lua/modules/editor.lua @@ -65,6 +65,11 @@ function M.blankline_conf() -- vim.api.nvim_command('autocmd CursorMoved * IndentBlanklineRefresh') end +function M.aniseed_conf() + -- Compile fennel config to lua on startup + require('aniseed.env').init() +end + function M.treesitter_conf() vim.api.nvim_command('set foldmethod=expr') vim.api.nvim_command('set foldexpr=nvim_treesitter#foldexpr()') diff --git a/home/.config/nvim/lua/modules/tools.lua b/home/.config/nvim/lua/modules/tools.lua index 6daf042..158a747 100644 --- a/home/.config/nvim/lua/modules/tools.lua +++ b/home/.config/nvim/lua/modules/tools.lua @@ -70,6 +70,10 @@ function M.neogit_conf() } end +function M.diffview_conf() + require('diffview').setup {diff_binaries = true} +end + function M.asynctasks_conf() -- vim.g.asyncrun_open = 8 -- when using quickfix window (output=terminal is preferable) vim.g.asyncrun_rootmarks = {'.git', '.svn', '.root', '.hg', '.projectile'} diff --git a/home/.config/nvim/lua/options.lua b/home/.config/nvim/lua/options.lua index 09a21c8..4ee6893 100644 --- a/home/.config/nvim/lua/options.lua +++ b/home/.config/nvim/lua/options.lua @@ -72,6 +72,7 @@ function M.load_options() opt.grepformat = '%f:%l:%c:%m' opt.grepprg = 'rg --hidden --vimgrep --smart-case --' opt.diffopt = 'filler,iwhite,internal,algorithm:patience' + -- opt.spell = true -- Transparency opt.pumblend = 5 diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index dfa6034..a4abb83 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -56,6 +56,7 @@ return require('packer').startup( } use { 'folke/which-key.nvim', + event = 'VimEnter', config = ui.whichkey_conf } use { @@ -83,6 +84,11 @@ return require('packer').startup( event = 'BufRead', config = editor.blankline_conf } + use { -- TODO: config (lua -> fennel) + learn clojure, fennel, guile scheme + 'Olical/conjure', + ft = {'clojure', 'fennel', 'scheme'}, + requires = {{'Olical/aniseed', config = editor.aniseed_conf}} + } use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', @@ -138,7 +144,7 @@ return require('packer').startup( use { -- TODO: move to nvim-parinfer (lua) 'eraserhd/parinfer-rust', run = 'cargo build --release', - ft = {'clojure', 'lisp', 'scheme'} + ft = {'clojure', 'lisp', 'scheme', 'fennel'} } --------- @@ -193,27 +199,26 @@ return require('packer').startup( 'hrsh7th/nvim-cmp', event = 'InsertEnter', wants = 'LuaSnip', - requires = { - { - 'L3MON4D3/LuaSnip', - wants = 'friendly-snippets', - requires = {{'rafamadriz/friendly-snippets', opt = true}}, - config = completion.snippets_conf, - opt = true - }, - {'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp', opt = true}, - {'hrsh7th/cmp-path', after = 'nvim-cmp', opt = true}, - {'hrsh7th/cmp-buffer', after = 'nvim-cmp', opt = true}, - -- {'hrsh7th/cmp-calc', after = 'nvim-cmp', opt = true}, - -- {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}, opt = true}, - {'f3fora/cmp-spell', after = 'nvim-cmp', opt = true}, - {'hrsh7th/cmp-emoji', after = 'nvim-cmp', opt = true}, - {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp', opt = true}, - {'kdheepak/cmp-latex-symbols', after = 'nvim-cmp', opt = true}, - {'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp', opt = true} - }, + requires = {{ + 'L3MON4D3/LuaSnip', + wants = 'friendly-snippets', + requires = {{'rafamadriz/friendly-snippets', opt = true}}, + config = completion.snippets_conf, + opt = true + }}, config = completion.cmp_conf } + use {'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp'} + use {'hrsh7th/cmp-path', after = 'nvim-cmp'} + use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'} + -- use {'hrsh7th/cmp-calc', after = 'nvim-cmp'} + -- use {'f3fora/cmp-nuspell', after = 'nvim-cmp', rocks={'lua-nuspell'}} + use {'f3fora/cmp-spell', after = 'nvim-cmp'} + use {'hrsh7th/cmp-emoji', after = 'nvim-cmp'} + use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'} + use {'kdheepak/cmp-latex-symbols', after = 'nvim-cmp'} + use {'andersevenrud/compe-tmux', after = 'nvim-cmp', branch = 'cmp'} + use {'PaterJason/cmp-conjure', after = {'conjure', 'nvim-cmp'}} use { 'windwp/nvim-autopairs', after = 'nvim-cmp', @@ -281,17 +286,11 @@ return require('packer').startup( 'TimUntersberger/neogit', cmd = 'Neogit', wants = {'diffview.nvim', 'plenary.nvim'}, - requires = { - { - 'sindrets/diffview.nvim', - config = function() - require('diffview').setup { - diff_binaries = true - } - end, - opt = true - } - }, + requires = {{ + 'sindrets/diffview.nvim', + config = tools.diffview_conf, + opt = true + }}, config = tools.neogit_conf } use { @@ -381,16 +380,12 @@ return require('packer').startup( run = ':TSInstall http', config = tools.rest_conf } - -- use { -- TODO: mappings - -- 'rktjmp/hotpot.nvim', - -- config = function() require('hotpot') end - -- } use { 'sbdchd/neoformat', cmd = 'Neoformat' } use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} -- Just for benchmarking - -- TODO: conjure + cmp-conjure, dial.nvim, rust-tools.nvim, crates.nvim, go.nvim + -- TODO: dial.nvim, rust-tools.nvim, crates.nvim, go.nvim, clojure-vim/*, vim-pandoc end )