Compare commits
37 Commits
bd3bfa42aa
...
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 | |||
5915f2fd03 | |||
757f728e72 | |||
1de9b47d92 | |||
6d763296a7 | |||
60a51b9b10 | |||
e6b8cb69c8 | |||
dd0c879db6 | |||
9de08eabe5 |
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
lc.log
|
||||||
|
|
||||||
|
lua/*.lua
|
||||||
|
plugin/
|
25
README.md
25
README.md
@ -1,14 +1,33 @@
|
|||||||
Welcome to my **neovim** config folder
|
Welcome to my **neovim** config folder
|
||||||
|
|
||||||
Through out the years (4 years) of using Neovim, I have came up with a very large neovim configuration. But now I drop most of them. Neovim support for Lua script is on the way, this rewrite will be all (most of) in Lua. I prefer the LISP syntax over Lua syntax, so I use Fennel with aniseed.
|
Through out the years (4 years) of using Neovim, I have came up with a very large neovim configuration. But now I drop most of them. This rewrite will be all in Lua. I prefer the S-expression syntax over Lua syntax, so I use Fennel with aniseed.
|
||||||
|
|
||||||
There will be a lightline configuration, everyone loves a nice UI.
|
Now that neovim has 0.5 released, I changed the config to use its LSP and some nightly tree-sitter.
|
||||||
|
|
||||||
I mostly code in C, C++, Python, Golang, Javascript, Java, Kotlin, Rust, Haskell (ordered by my own usage frequency).
|
## Code environment
|
||||||
|
|
||||||
|
- C/C++/ObjC/ObjC++
|
||||||
|
- Python 3
|
||||||
|
- Golang
|
||||||
|
- Rust
|
||||||
|
- Scala
|
||||||
|
- Javascript (NodeJS, Deno)
|
||||||
|
|
||||||
|
- Java/Kotlin
|
||||||
|
- Haskell
|
||||||
|
- Ocaml with Coq
|
||||||
|
|
||||||
## Change log
|
## Change log
|
||||||
|
|
||||||
|
Newest on top
|
||||||
|
|
||||||
|
- Remove pollen
|
||||||
|
- Replace identLine with indent_blankline
|
||||||
|
- Setup bootstrap from scratch install
|
||||||
|
- Setup lsp, treesitter
|
||||||
|
- Change to github theme
|
||||||
|
- Change plugins to fennel
|
||||||
|
- Remove language client Neovim
|
||||||
- Initialize the Git Repo
|
- Initialize the Git Repo
|
||||||
- Switch from pure VimL to Lua using Fennel+aniseed
|
- Switch from pure VimL to Lua using Fennel+aniseed
|
||||||
- Switch from vim-plug to packer.nvim
|
- Switch from vim-plug to packer.nvim
|
||||||
|
18
fnl/init.fnl
18
fnl/init.fnl
@ -46,10 +46,28 @@
|
|||||||
(set nvim.o.expandtab true)
|
(set nvim.o.expandtab true)
|
||||||
(set nvim.bo.expandtab true)
|
(set nvim.bo.expandtab true)
|
||||||
|
|
||||||
|
(set nvim.o.breakindent true)
|
||||||
|
(set nvim.wo.breakindent true)
|
||||||
|
|
||||||
|
(set nvim.o.linebreak true)
|
||||||
|
(set nvim.wo.linebreak true)
|
||||||
|
|
||||||
(set nvim.o.number true)
|
(set nvim.o.number true)
|
||||||
(set nvim.wo.number true)
|
(set nvim.wo.number true)
|
||||||
|
|
||||||
(set nvim.o.relativenumber true)
|
(set nvim.o.relativenumber true)
|
||||||
(set nvim.wo.relativenumber true)
|
(set nvim.wo.relativenumber true)
|
||||||
|
|
||||||
|
(set nvim.o.signcolumn "yes")
|
||||||
|
(set nvim.wo.signcolumn "yes")
|
||||||
|
|
||||||
|
(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 "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})
|
54
fnl/plugins.fnl
Normal file
54
fnl/plugins.fnl
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
(local packer (require :packer))
|
||||||
|
|
||||||
|
(packer.init {:git {:clone_timeout 120}})
|
||||||
|
|
||||||
|
(packer.startup (fn [use]
|
||||||
|
(use :wbthomason/packer.nvim)
|
||||||
|
(use :Olical/aniseed) ; fennel to lua
|
||||||
|
|
||||||
|
; themes
|
||||||
|
; (use :projekt0n/github-nvim-theme)
|
||||||
|
(use {
|
||||||
|
1 :FrenzyExists/aquarium-vim
|
||||||
|
:run ":silent! colorscheme aquarium"
|
||||||
|
})
|
||||||
|
|
||||||
|
; ui
|
||||||
|
(use :kyazdani42/nvim-web-devicons)
|
||||||
|
(use :nvim-lualine/lualine.nvim)
|
||||||
|
(use :lukas-reineke/indent-blankline.nvim)
|
||||||
|
(use :ntpeters/vim-better-whitespace)
|
||||||
|
; (use :valloric/matchtagalways)
|
||||||
|
|
||||||
|
; util
|
||||||
|
(use :cocopon/vaffle.vim)
|
||||||
|
(use :jeetsukumaran/vim-buffergator)
|
||||||
|
(use :tpope/vim-fugitive)
|
||||||
|
(use :ur4ltz/surround.nvim)
|
||||||
|
(use :b3nj5m1n/kommentary)
|
||||||
|
(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
|
||||||
|
(use :wakatime/vim-wakatime)
|
||||||
|
(use {1 :kkoomen/vim-doge :run ":call doge#install()"})))
|
@ -2,10 +2,15 @@
|
|||||||
{require {nvim aniseed.nvim
|
{require {nvim aniseed.nvim
|
||||||
nu aniseed.nvim.util}})
|
nu aniseed.nvim.util}})
|
||||||
|
|
||||||
|
(nvim.ex.autocmd "BufRead * DetectIndent")
|
||||||
|
|
||||||
|
;; theme
|
||||||
|
(nvim.command "silent! colorscheme aquarium")
|
||||||
|
|
||||||
;; 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 "")
|
||||||
@ -15,7 +20,42 @@
|
|||||||
(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 :n :<leader>ff ":lua require('fzf-lua').live_grep()<CR>" {:noremap true :silent true})
|
||||||
(nvim.set_keymap "" :sr "<Plug>(operator-surround-replace)" {:silent true})
|
|
||||||
|
|
||||||
|
;; surround.nvim
|
||||||
|
(global surround (require :surround))
|
||||||
|
(surround.setup
|
||||||
|
{:mappings_style "sandwich"
|
||||||
|
})
|
||||||
|
|
||||||
|
;; kommentary
|
||||||
|
(global kommentary (require :kommentary.config))
|
||||||
|
(kommentary.configure_language :default {:prefer_single_line_comments true})
|
||||||
|
(kommentary.configure_language :objcpp {:prefer_single_line_comments true})
|
||||||
|
|
||||||
|
;; lualine
|
||||||
|
(global lualine (require :lualine))
|
||||||
|
(lualine.setup
|
||||||
|
{:options {:theme :aquarium
|
||||||
|
:section_separators ["" ""]
|
||||||
|
:component_separators ["" ""]
|
||||||
|
:icons_enabled true}
|
||||||
|
:sections {:lualine_a {1 {1 :mode
|
||||||
|
:upper true}}
|
||||||
|
:lualine_b {1 {1 :branch
|
||||||
|
:icon ""}}
|
||||||
|
:lualine_c {1 {1 :filename
|
||||||
|
:file_status true}}
|
||||||
|
:lualine_x ["%{&expandtab?shiftwidth().\"sp\":\"tabs\"}" "encoding" "fileformat" "filetype"]
|
||||||
|
:lualine_y ["progress"]
|
||||||
|
:lualine_z ["location"]}
|
||||||
|
:inactive_sections {:lualine_a {}
|
||||||
|
:lualine_b {}
|
||||||
|
:lualine_c ["filename"]
|
||||||
|
:lualine_x ["location"]
|
||||||
|
:lualine_y {}
|
||||||
|
:lualine_z {}}
|
||||||
|
:extensions ["fugitive"]})
|
||||||
|
37
init.lua
37
init.lua
@ -1,5 +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
|
||||||
vim.g.polyglot_disabled = {"markdown", "javascript"}
|
|
||||||
|
|
||||||
require('plugins')
|
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
local packer = require('packer')
|
|
||||||
|
|
||||||
packer.startup(function(use)
|
|
||||||
use 'wbthomason/packer.nvim'
|
|
||||||
use 'Olical/aniseed'
|
|
||||||
|
|
||||||
use {
|
|
||||||
'hoob3rt/lualine.nvim',
|
|
||||||
requires = {'kyazdani42/nvim-web-devicons', opt = true},
|
|
||||||
config = function()
|
|
||||||
require('lualine').setup{
|
|
||||||
options = {
|
|
||||||
theme = 'nord',
|
|
||||||
section_separators = {'', ''},
|
|
||||||
component_separators = {'', ''},
|
|
||||||
icons_enabled = true,
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = { {'mode', upper = true} },
|
|
||||||
lualine_b = { {'branch', icon = ''} },
|
|
||||||
lualine_c = { {'filename', file_status = true} },
|
|
||||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
|
||||||
lualine_y = { 'progress' },
|
|
||||||
lualine_z = { 'location' },
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = { },
|
|
||||||
lualine_b = { },
|
|
||||||
lualine_c = { 'filename' },
|
|
||||||
lualine_x = { 'location' },
|
|
||||||
lualine_y = { },
|
|
||||||
lualine_z = { }
|
|
||||||
},
|
|
||||||
extensions = { 'fugitive' }
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
use 'Yggdroot/indentLine'
|
|
||||||
use 'ntpeters/vim-better-whitespace'
|
|
||||||
use 'valloric/matchtagalways'
|
|
||||||
|
|
||||||
use 'cocopon/vaffle.vim'
|
|
||||||
use 'jeetsukumaran/vim-buffergator'
|
|
||||||
|
|
||||||
use 'tpope/vim-fugitive'
|
|
||||||
|
|
||||||
use 'kana/vim-operator-user'
|
|
||||||
use 'rhysd/vim-operator-surround'
|
|
||||||
use 'chaoren/vim-wordmotion'
|
|
||||||
|
|
||||||
use 'nelstrom/vim-visual-star-search'
|
|
||||||
|
|
||||||
use 'wakatime/vim-wakatime'
|
|
||||||
|
|
||||||
use 'sheerun/vim-polyglot'
|
|
||||||
end)
|
|
Reference in New Issue
Block a user