Compare commits

...

35 Commits

Author SHA1 Message Date
7dfccffab5 update bootstrap code to work smoothly 2024-04-21 23:35:55 +07:00
b2df93a1f6 add haskell lsp settings 2024-03-16 21:36:59 +07:00
85ccc75998 change neovide vfx 2024-03-16 21:36:59 +07:00
8c0072e74b use yadi for indentation recognition 2024-03-16 21:36:59 +07:00
847ca0e7ac add fzf for searching files 2024-03-07 11:09:43 +07:00
cd38bf3d56 change to aquarium theme 2022-02-15 13:09:05 +07:00
4095a0443c change surround.nvim repo
Old repo is deleted
2022-02-15 13:08:35 +07:00
94df85afed update lsp configs 2021-12-17 15:12:37 +07:00
a8706ae56e add nvim-cmp 2021-12-14 15:15:23 +00:00
edb2f03d22 remove unused plugins 2021-12-14 15:15:01 +00:00
f11f3892fe update settings 2021-12-14 15:14:45 +00:00
766fd78e81 optional lsp for c/c++ and swift 2021-12-07 15:21:49 +00:00
60b783b822 use surround.nvim 2021-12-07 15:21:37 +00:00
8d3952ec91 update neovide settings 2021-12-07 15:21:25 +00:00
bfd569b102 using nvim-lualine/lualine.nvim 2021-10-22 13:52:31 +00:00
a9e30eb2f6 use vaffle | bench nvim-tree 2021-10-11 04:22:15 +00:00
e3ed38ab86 add <leader>e to show errors | need optimization 2021-10-11 04:21:50 +00:00
6262c250a5 fix nvim-github-theme config field name 2021-10-11 04:21:22 +00:00
0e309f4fde add swift lsp 2021-08-06 15:58:23 +07:00
4ad65024f6 use nvim tree 2021-08-06 11:15:50 +07:00
f4a4639198 add treesitter textobjects 2021-07-15 03:41:13 +07:00
cf9d046c43 add ccls arguments 2021-07-15 03:17:44 +07:00
2b765f8198 setup neovide 2021-07-15 02:52:28 +07:00
8d371affb6 add ccls lsp 2021-07-14 15:17:28 +07:00
b654a67a2e update changelog 2021-07-13 19:26:11 +00:00
b0d8c3c977 update plugins 2021-07-13 19:24:46 +00:00
b3a32ba954 do not mess up aniseed 2021-07-13 19:24:30 +00:00
fed4931d42 add lspconfig comp treesitter 2021-07-11 18:56:45 +00:00
b84629bef7 make plugins installation boostrap from init.lua 2021-07-11 11:24:05 +00:00
5915f2fd03 add a boostrap script 2021-07-11 10:42:29 +00:00
757f728e72 update config 2021-07-11 10:42:15 +00:00
1de9b47d92 update 2021-07-09 21:05:30 +00:00
6d763296a7 update 2021-05-05 10:01:29 +07:00
60a51b9b10 update 2021-05-05 00:28:45 +07:00
e6b8cb69c8 add colorscheme photon 2021-04-23 17:00:27 +07:00
8 changed files with 223 additions and 95 deletions

2
.gitignore vendored
View File

@ -1,6 +1,4 @@
lc.log
lua/*.lua
!lua/plugins.lua
plugin/

View File

@ -1,14 +1,33 @@
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
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
- Switch from pure VimL to Lua using Fennel+aniseed
- Switch from vim-plug to packer.nvim

View File

@ -58,4 +58,16 @@
(set nvim.o.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 "lsp")

59
fnl/lsp.fnl Normal file
View 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
View 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()"})))

View File

@ -2,10 +2,15 @@
{require {nvim aniseed.nvim
nu aniseed.nvim.util}})
(nvim.ex.autocmd "BufRead * DetectIndent")
;; theme
(nvim.command "silent! colorscheme aquarium")
;; buffergator
(set nvim.g.buffergator_display_regime "parentdir")
;; vaffle
;; Vaffle
(defn open-vaffle []
(let [bufname (nvim.fn.bufname "%")]
(if (= bufname "")
@ -15,21 +20,42 @@
(nu.fn-bridge :OpenVaffle :user.plugin.settings :open-vaffle)
(nvim.set_keymap :n :<leader>dd ":call OpenVaffle()<CR>" {:noremap true :silent true})
;; vim-operator-surround
(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})
;; fzf
;; language-client neovim
(set nvim.g.LanguageClient_loggingFile "/Users/lap12003/.config/nvim/lc.log")
(set nvim.g.LanguageClient_serverCommands
{:c ["ccls"]
:cpp ["ccls"]
:objc ["ccls"]
:objcpp ["ccls"]
:go ["gopls"]
:rust ["rls"]})
(nvim.set_keymap :n :<leader>ff ":lua require('fzf-lua').live_grep()<CR>" {:noremap true :silent true})
(nvim.set_keymap "" :gd "<Plug>(lcn-definition)" {:silent true})
(nvim.set_keymap "" :gh "<Plug>(lcn-hover)" {:silent true})
(nvim.set_keymap "" :gr "<Plug>(lcn-references)" {: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"]})

View File

@ -1,9 +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.polyglot_disabled = {"markdown", "javascript"}
require('plugins')
require('kommentary.config').configure_language("default", {
prefer_single_line_comments = true,
})
end

View File

@ -1,65 +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 'b3nj5m1n/kommentary'
use 'nelstrom/vim-visual-star-search'
use 'wakatime/vim-wakatime'
use 'sheerun/vim-polyglot'
use 'rescript-lang/vim-rescript'
use {
'autozimu/LanguageClient-neovim',
branch = 'next',
run = 'bash install.sh'
}
end)