Compare commits
29 Commits
5915f2fd03
...
main
Author | SHA1 | Date | |
---|---|---|---|
7dfccffab5 | |||
b2df93a1f6 | |||
85ccc75998 | |||
8c0072e74b | |||
847ca0e7ac | |||
cd38bf3d56 | |||
4095a0443c | |||
94df85afed | |||
a8706ae56e | |||
edb2f03d22 | |||
f11f3892fe | |||
766fd78e81 | |||
60b783b822 | |||
8d3952ec91 | |||
bfd569b102 | |||
a9e30eb2f6 | |||
e3ed38ab86 | |||
6262c250a5 | |||
0e309f4fde | |||
4ad65024f6 | |||
f4a4639198 | |||
cf9d046c43 | |||
2b765f8198 | |||
8d371affb6 | |||
b654a67a2e | |||
b0d8c3c977 | |||
b3a32ba954 | |||
fed4931d42 | |||
b84629bef7 |
@ -21,6 +21,10 @@ Now that neovim has 0.5 released, I changed the config to use its LSP and some n
|
|||||||
|
|
||||||
Newest on top
|
Newest on top
|
||||||
|
|
||||||
|
- Remove pollen
|
||||||
|
- Replace identLine with indent_blankline
|
||||||
|
- Setup bootstrap from scratch install
|
||||||
|
- Setup lsp, treesitter
|
||||||
- Change to github theme
|
- Change to github theme
|
||||||
- Change plugins to fennel
|
- Change plugins to fennel
|
||||||
- Remove language client Neovim
|
- Remove language client Neovim
|
||||||
|
109
aniseed_env.lua
109
aniseed_env.lua
@ -1,109 +0,0 @@
|
|||||||
local _2afile_2a = "fnl/aniseed/env.fnl"
|
|
||||||
local _0_
|
|
||||||
do
|
|
||||||
local name_0_ = "aniseed.env"
|
|
||||||
local module_0_
|
|
||||||
do
|
|
||||||
local x_0_ = package.loaded[name_0_]
|
|
||||||
if ("table" == type(x_0_)) then
|
|
||||||
module_0_ = x_0_
|
|
||||||
else
|
|
||||||
module_0_ = {}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
module_0_["aniseed/module"] = name_0_
|
|
||||||
module_0_["aniseed/locals"] = ((module_0_)["aniseed/locals"] or {})
|
|
||||||
do end (module_0_)["aniseed/local-fns"] = ((module_0_)["aniseed/local-fns"] or {})
|
|
||||||
do end (package.loaded)[name_0_] = module_0_
|
|
||||||
_0_ = module_0_
|
|
||||||
end
|
|
||||||
local autoload
|
|
||||||
local function _1_(...)
|
|
||||||
return (require("aniseed.autoload")).autoload(...)
|
|
||||||
end
|
|
||||||
autoload = _1_
|
|
||||||
local function _2_(...)
|
|
||||||
local ok_3f_0_, val_0_ = nil, nil
|
|
||||||
local function _2_()
|
|
||||||
return {autoload("aniseed.compile"), autoload("aniseed.fennel"), autoload("aniseed.fs"), autoload("aniseed.nvim")}
|
|
||||||
end
|
|
||||||
ok_3f_0_, val_0_ = pcall(_2_)
|
|
||||||
if ok_3f_0_ then
|
|
||||||
_0_["aniseed/local-fns"] = {autoload = {compile = "aniseed.compile", fennel = "aniseed.fennel", fs = "aniseed.fs", nvim = "aniseed.nvim"}}
|
|
||||||
return val_0_
|
|
||||||
else
|
|
||||||
return print(val_0_)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local _local_0_ = _2_(...)
|
|
||||||
local compile = _local_0_[1]
|
|
||||||
local fennel = _local_0_[2]
|
|
||||||
local fs = _local_0_[3]
|
|
||||||
local nvim = _local_0_[4]
|
|
||||||
local _2amodule_2a = _0_
|
|
||||||
local _2amodule_name_2a = "aniseed.env"
|
|
||||||
do local _ = ({nil, _0_, nil, {{}, nil, nil, nil}})[2] end
|
|
||||||
local config_dir
|
|
||||||
do
|
|
||||||
local v_0_ = string.gsub(nvim.fn.stdpath("config"), "\\", "/")
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["config-dir"] = v_0_
|
|
||||||
config_dir = v_0_
|
|
||||||
end
|
|
||||||
local quiet_require
|
|
||||||
do
|
|
||||||
local v_0_
|
|
||||||
local function quiet_require0(m)
|
|
||||||
local ok_3f, err = nil, nil
|
|
||||||
local function _3_()
|
|
||||||
-- nvim.ex.echoerr("require "..m.." fadjflaksdfjlskadfj")
|
|
||||||
return require(m)
|
|
||||||
end
|
|
||||||
ok_3f, err = pcall(_3_)
|
|
||||||
if (not ok_3f and not err:find(("module '" .. m .. "' not found"))) then
|
|
||||||
return nvim.ex.echoerr(err)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
v_0_ = quiet_require0
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["quiet-require"] = v_0_
|
|
||||||
quiet_require = v_0_
|
|
||||||
end
|
|
||||||
local init
|
|
||||||
do
|
|
||||||
local v_0_
|
|
||||||
do
|
|
||||||
local v_0_0
|
|
||||||
local function init0(opts)
|
|
||||||
local opts0
|
|
||||||
if ("table" == type(opts)) then
|
|
||||||
opts0 = opts
|
|
||||||
else
|
|
||||||
opts0 = {}
|
|
||||||
end
|
|
||||||
local glob_expr = "**/*.fnl"
|
|
||||||
local fnl_dir = (opts0.input or (config_dir .. "/fnl"))
|
|
||||||
local lua_dir = (opts0.output or (config_dir .. "/lua"))
|
|
||||||
package.path = (package.path .. ";" .. lua_dir .. "/?.lua")
|
|
||||||
local function _4_(path)
|
|
||||||
if fs["macro-file-path?"](path) then
|
|
||||||
return path
|
|
||||||
else
|
|
||||||
return string.gsub(path, ".fnl$", ".lua")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if (((false ~= opts0.compile) or os.getenv("ANISEED_ENV_COMPILE")) and fs["glob-dir-newer?"](fnl_dir, lua_dir, glob_expr, _4_)) then
|
|
||||||
fennel["add-path"]((fnl_dir .. "/?.fnl"))
|
|
||||||
compile.glob(glob_expr, fnl_dir, lua_dir, opts0)
|
|
||||||
end
|
|
||||||
return quiet_require("plugins")
|
|
||||||
end
|
|
||||||
v_0_0 = init0
|
|
||||||
_0_["init"] = v_0_0
|
|
||||||
v_0_ = v_0_0
|
|
||||||
end
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["init"] = v_0_
|
|
||||||
init = v_0_
|
|
||||||
end
|
|
||||||
return nil
|
|
@ -1,6 +0,0 @@
|
|||||||
local execute = vim.api.nvim_command
|
|
||||||
|
|
||||||
execute 'packadd packer.nvim'
|
|
||||||
execute 'packadd aniseed'
|
|
||||||
require('aniseed.env').init({compile = true})
|
|
||||||
execute 'PackerUpdate'
|
|
@ -1,6 +1,5 @@
|
|||||||
(module user.config
|
(module user.config
|
||||||
{require {nvim aniseed.nvim
|
{require {nvim aniseed.nvim}})
|
||||||
nu aniseed.nvim.util}})
|
|
||||||
|
|
||||||
(defn- noremap [mode from to]
|
(defn- noremap [mode from to]
|
||||||
"Sets a mapping with {:noremap true}."
|
"Sets a mapping with {:noremap true}."
|
||||||
@ -64,5 +63,11 @@
|
|||||||
|
|
||||||
(set nvim.o.termguicolors true)
|
(set nvim.o.termguicolors true)
|
||||||
|
|
||||||
|
; neovide
|
||||||
|
; (set nvim.g.neovide_fullscreen true)
|
||||||
|
(set nvim.g.neovide_cursor_vfx_mode "railgun")
|
||||||
|
(set nvim.o.guifont "FiraCode Nerd Font Mono:h16")
|
||||||
|
|
||||||
(require "plugins")
|
(require "plugins")
|
||||||
(require "settings")
|
(require "settings")
|
||||||
|
(require "lsp")
|
||||||
|
59
fnl/lsp.fnl
Normal file
59
fnl/lsp.fnl
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
(module user.lsp
|
||||||
|
{require {nvim aniseed.nvim}})
|
||||||
|
|
||||||
|
(local lspconfig (require :lspconfig))
|
||||||
|
(local treesitter_configs (require :nvim-treesitter.configs))
|
||||||
|
(local treesitter_install (require :nvim-treesitter.install))
|
||||||
|
(local cmp (require :cmp))
|
||||||
|
|
||||||
|
(nvim.set_keymap "" :gd "<cmd>lua vim.lsp.buf.definition()<CR>" {:silent true :noremap true})
|
||||||
|
(nvim.set_keymap "" :gh "<cmd>lua vim.lsp.buf.hover()<CR>" {:silent true :noremap true})
|
||||||
|
(nvim.set_keymap "" :gi "<cmd>lua vim.lsp.buf.implementation()<CR>" {:silent true :noremap true})
|
||||||
|
(nvim.set_keymap "" :gr "<cmd>lua vim.lsp.buf.references()<CR>" {:silent true :noremap true})
|
||||||
|
(nvim.set_keymap "" :gs "<cmd>lua vim.lsp.buf.signature_help()<CR>" {:silent true :noremap true})
|
||||||
|
(nvim.set_keymap "" :<leader>e "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>" {:silent true :noremap true})
|
||||||
|
|
||||||
|
(lspconfig.rust_analyzer.setup {})
|
||||||
|
(lspconfig.gopls.setup {})
|
||||||
|
(lspconfig.hls.setup {
|
||||||
|
:cmd ["haskell-language-server-wrapper" "--lsp" "--logfile" "/home/r00t/.cache/nvim/hls.log" "--debug"]
|
||||||
|
})
|
||||||
|
|
||||||
|
; treesitter
|
||||||
|
(set treesitter_install.compilers ["clang"])
|
||||||
|
(treesitter_configs.setup {:ensure_installed ["c" "cpp" "python" "go" "rust" "javascript" "typescript" "lua"]
|
||||||
|
:highlight {:enable true}
|
||||||
|
:indent {:enable true}
|
||||||
|
:textobjects {:select {:enable true
|
||||||
|
:keymaps {:ia "@parameter.inner"
|
||||||
|
:oa "@parameter.outer"}}
|
||||||
|
:swap {:enable true
|
||||||
|
:swap_next {:<S-l> "@parameter.inner"}
|
||||||
|
:swap_previous {:<S-h> "@parameter.inner"}}}})
|
||||||
|
|
||||||
|
;; completion
|
||||||
|
(set nvim.o.completeopt "menu,menuone,noselect")
|
||||||
|
|
||||||
|
(def- cmp-src-menu-items
|
||||||
|
{:buffer "buffer"
|
||||||
|
:nvim_lsp "lsp"
|
||||||
|
:path "path"})
|
||||||
|
|
||||||
|
(def- cmp-srcs
|
||||||
|
[{:name :nvim_lsp}
|
||||||
|
{:name :path}
|
||||||
|
{:name :buffer}])
|
||||||
|
|
||||||
|
(cmp.setup {:formatting
|
||||||
|
{:format (fn [entry item]
|
||||||
|
(set item.menu (or (. cmp-src-menu-items entry.source.name) ""))
|
||||||
|
item)}
|
||||||
|
:mapping {:<S-k> (cmp.mapping.select_prev_item)
|
||||||
|
:<S-j> (cmp.mapping.select_next_item)
|
||||||
|
; :<C-b> (cmp.mapping.scroll_docs (- 4))
|
||||||
|
; :<C-f> (cmp.mapping.scroll_docs 4)
|
||||||
|
; :<C-Space> (cmp.mapping.complete)
|
||||||
|
; :<C-e> (cmp.mapping.close)
|
||||||
|
:<CR> (cmp.mapping.confirm {:behavior cmp.ConfirmBehavior.Insert
|
||||||
|
:select true})}
|
||||||
|
:sources cmp-srcs})
|
@ -7,29 +7,48 @@
|
|||||||
(use :Olical/aniseed) ; fennel to lua
|
(use :Olical/aniseed) ; fennel to lua
|
||||||
|
|
||||||
; themes
|
; themes
|
||||||
(use :axvr/photon.vim)
|
; (use :projekt0n/github-nvim-theme)
|
||||||
(use :projekt0n/github-nvim-theme)
|
(use {
|
||||||
|
1 :FrenzyExists/aquarium-vim
|
||||||
|
:run ":silent! colorscheme aquarium"
|
||||||
|
})
|
||||||
|
|
||||||
; ui
|
; ui
|
||||||
(use {1 :hoob3rt/lualine.nvim
|
(use :kyazdani42/nvim-web-devicons)
|
||||||
:requires {1 :kyazdani42/nvim-web-devicons :opt true}})
|
(use :nvim-lualine/lualine.nvim)
|
||||||
(use :junegunn/goyo.vim)
|
(use :lukas-reineke/indent-blankline.nvim)
|
||||||
(use :Yggdroot/indentLine)
|
|
||||||
(use :ntpeters/vim-better-whitespace)
|
(use :ntpeters/vim-better-whitespace)
|
||||||
(use :valloric/matchtagalways)
|
; (use :valloric/matchtagalways)
|
||||||
|
|
||||||
; util
|
; util
|
||||||
(use :cocopon/vaffle.vim)
|
(use :cocopon/vaffle.vim)
|
||||||
(use :jeetsukumaran/vim-buffergator)
|
(use :jeetsukumaran/vim-buffergator)
|
||||||
(use :tpope/vim-fugitive)
|
(use :tpope/vim-fugitive)
|
||||||
(use :kana/vim-operator-user)
|
(use :ur4ltz/surround.nvim)
|
||||||
(use :rhysd/vim-operator-surround)
|
|
||||||
(use :chaoren/vim-wordmotion)
|
|
||||||
(use :b3nj5m1n/kommentary)
|
(use :b3nj5m1n/kommentary)
|
||||||
(use :nelstrom/vim-visual-star-search)
|
(use :nelstrom/vim-visual-star-search)
|
||||||
|
(use :timakro/vim-yadi)
|
||||||
|
|
||||||
|
(use {
|
||||||
|
1 :nvim-treesitter/nvim-treesitter
|
||||||
|
:run (fn [] (let [ts (require :nvim-treesitter.install)]
|
||||||
|
(ts.update {:with_sync true})))
|
||||||
|
})
|
||||||
|
(use {
|
||||||
|
1 :nvim-treesitter/nvim-treesitter-textobjects
|
||||||
|
:after "nvim-treesitter"
|
||||||
|
})
|
||||||
|
(use :neovim/nvim-lspconfig)
|
||||||
|
|
||||||
|
; completion
|
||||||
|
(use :hrsh7th/nvim-cmp)
|
||||||
|
(use :hrsh7th/cmp-nvim-lua)
|
||||||
|
(use :hrsh7th/cmp-nvim-lsp)
|
||||||
|
(use :hrsh7th/cmp-buffer)
|
||||||
|
(use :hrsh7th/cmp-path)
|
||||||
|
|
||||||
|
(use :ibhagwan/fzf-lua)
|
||||||
|
|
||||||
; others
|
; others
|
||||||
(use :wakatime/vim-wakatime)
|
(use :wakatime/vim-wakatime)
|
||||||
; (use :rescript-lang/vim-rescript)
|
|
||||||
(use :otherjoel/vim-pollen)
|
|
||||||
(use {1 :kkoomen/vim-doge :run ":call doge#install()"})))
|
(use {1 :kkoomen/vim-doge :run ":call doge#install()"})))
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
{require {nvim aniseed.nvim
|
{require {nvim aniseed.nvim
|
||||||
nu aniseed.nvim.util}})
|
nu aniseed.nvim.util}})
|
||||||
|
|
||||||
|
(nvim.ex.autocmd "BufRead * DetectIndent")
|
||||||
|
|
||||||
;; theme
|
;; theme
|
||||||
(global github-theme (require :github-theme))
|
(nvim.command "silent! colorscheme aquarium")
|
||||||
(github-theme.setup {:themeStyle :dark})
|
|
||||||
|
|
||||||
;; buffergator
|
;; buffergator
|
||||||
(set nvim.g.buffergator_display_regime "parentdir")
|
(set nvim.g.buffergator_display_regime "parentdir")
|
||||||
|
|
||||||
;; vaffle
|
;; Vaffle
|
||||||
(defn open-vaffle []
|
(defn open-vaffle []
|
||||||
(let [bufname (nvim.fn.bufname "%")]
|
(let [bufname (nvim.fn.bufname "%")]
|
||||||
(if (= bufname "")
|
(if (= bufname "")
|
||||||
@ -19,21 +20,16 @@
|
|||||||
(nu.fn-bridge :OpenVaffle :user.plugin.settings :open-vaffle)
|
(nu.fn-bridge :OpenVaffle :user.plugin.settings :open-vaffle)
|
||||||
(nvim.set_keymap :n :<leader>dd ":call OpenVaffle()<CR>" {:noremap true :silent true})
|
(nvim.set_keymap :n :<leader>dd ":call OpenVaffle()<CR>" {:noremap true :silent true})
|
||||||
|
|
||||||
;; vim-operator-surround
|
;; fzf
|
||||||
(nvim.set_keymap "" :sa "<Plug>(operator-surround-append)" {:silent true})
|
|
||||||
(nvim.set_keymap "" :sd "<Plug>(operator-surround-delete)" {:silent true})
|
|
||||||
(nvim.set_keymap "" :sr "<Plug>(operator-surround-replace)" {:silent true})
|
|
||||||
|
|
||||||
;; pollen
|
(nvim.set_keymap :n :<leader>ff ":lua require('fzf-lua').live_grep()<CR>" {:noremap true :silent true})
|
||||||
(vim.cmd "
|
|
||||||
au! BufRead,BufNewFile,BufWritePost *.pm set filetype=pollen
|
|
||||||
au! BufRead,BufNewFile,BufWritePost *.pp set filetype=pollen
|
|
||||||
au! BufRead,BufNewFile,BufWritePost *.ptree set filetype=pollen
|
|
||||||
|
|
||||||
\" Suggested editor settings:
|
|
||||||
\" autocmd FileType pollen setlocal wrap \" Soft wrap (don't affect buffer)
|
;; surround.nvim
|
||||||
\" autocmd FileType pollen setlocal linebreak \" Wrap on word-breaks only
|
(global surround (require :surround))
|
||||||
")
|
(surround.setup
|
||||||
|
{:mappings_style "sandwich"
|
||||||
|
})
|
||||||
|
|
||||||
;; kommentary
|
;; kommentary
|
||||||
(global kommentary (require :kommentary.config))
|
(global kommentary (require :kommentary.config))
|
||||||
@ -43,7 +39,7 @@
|
|||||||
;; lualine
|
;; lualine
|
||||||
(global lualine (require :lualine))
|
(global lualine (require :lualine))
|
||||||
(lualine.setup
|
(lualine.setup
|
||||||
{:options {:theme :nightfly
|
{:options {:theme :aquarium
|
||||||
:section_separators ["" ""]
|
:section_separators ["" ""]
|
||||||
:component_separators ["" ""]
|
:component_separators ["" ""]
|
||||||
:icons_enabled true}
|
:icons_enabled true}
|
||||||
@ -53,7 +49,7 @@
|
|||||||
:icon ""}}
|
:icon ""}}
|
||||||
:lualine_c {1 {1 :filename
|
:lualine_c {1 {1 :filename
|
||||||
:file_status true}}
|
:file_status true}}
|
||||||
:lualine_x ["encoding" "fileformat" "filetype"]
|
:lualine_x ["%{&expandtab?shiftwidth().\"sp\":\"tabs\"}" "encoding" "fileformat" "filetype"]
|
||||||
:lualine_y ["progress"]
|
:lualine_y ["progress"]
|
||||||
:lualine_z ["location"]}
|
:lualine_z ["location"]}
|
||||||
:inactive_sections {:lualine_a {}
|
:inactive_sections {:lualine_a {}
|
||||||
|
33
init.lua
33
init.lua
@ -1 +1,34 @@
|
|||||||
|
-- Both a bootstraper and stub to call fnl/init.lua
|
||||||
|
|
||||||
|
local fn = vim.fn
|
||||||
|
local execute = vim.api.nvim_command
|
||||||
|
|
||||||
|
bootstrap = fn.empty(fn.glob(fn.stdpath('data')..'/site/pack/packer/start/')) > 0
|
||||||
|
if bootstrap then
|
||||||
|
local github = 'https://github.com/'
|
||||||
|
local packer_git = github..'wbthomason/packer.nvim'
|
||||||
|
local aniseed_git = github..'Olical/aniseed'
|
||||||
|
|
||||||
|
local install_path = fn.stdpath('data')..'/site/pack/packer/start/'
|
||||||
|
local packer_path = install_path..'packer.nvim'
|
||||||
|
local aniseed_path = install_path..'aniseed'
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("User", {
|
||||||
|
pattern = "PackerComplete",
|
||||||
|
callback = function()
|
||||||
|
vim.cmd(":qa!")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
fn.system({'git', 'clone', packer_git, packer_path})
|
||||||
|
fn.system({'git', 'clone', aniseed_git, aniseed_path})
|
||||||
|
|
||||||
|
-- load packer (to install plugins) and aniseed (compile fennel to lua)
|
||||||
|
execute 'packadd packer.nvim'
|
||||||
|
execute 'packadd aniseed'
|
||||||
|
-- load only plugins to install plugins
|
||||||
|
require('aniseed.env').init({compile = true, module = 'plugins'})
|
||||||
|
execute 'PackerUpdate'
|
||||||
|
else
|
||||||
vim.g['aniseed#env'] = true
|
vim.g['aniseed#env'] = true
|
||||||
|
end
|
||||||
|
9
setup.sh
9
setup.sh
@ -1,9 +0,0 @@
|
|||||||
git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
|
|
||||||
git clone https://github.com/Olical/aniseed ~/.local/share/nvim/site/pack/packer/start/aniseed
|
|
||||||
|
|
||||||
mv ~/.local/share/nvim/site/pack/packer/start/aniseed/lua/aniseed/env.lua ./
|
|
||||||
cp aniseed_env.lua ~/.local/share/nvim/site/pack/packer/start/aniseed/lua/aniseed/env.lua
|
|
||||||
|
|
||||||
nvim -u bootstrap.lua
|
|
||||||
|
|
||||||
mv env.lua ~/.local/share/nvim/site/pack/packer/start/aniseed/lua/aniseed/env.lua
|
|
Reference in New Issue
Block a user