This commit is contained in:
nganhkhoa 2021-07-09 21:05:30 +00:00
parent 6d763296a7
commit 1de9b47d92
7 changed files with 97 additions and 123 deletions

2
.gitignore vendored
View File

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

View File

@ -1,14 +1,29 @@
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
- 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

@ -63,6 +63,7 @@
(set nvim.wo.signcolumn "yes")
(set nvim.o.termguicolors true)
(nvim.command "colorscheme photon")
; (nvim.command "colorscheme photon")
(require "plugins")
(require "settings")

35
fnl/plugins.fnl Normal file
View File

@ -0,0 +1,35 @@
(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 :axvr/photon.vim)
(use :projekt0n/github-nvim-theme)
; ui
(use {1 :hoob3rt/lualine.nvim
:requires {1 :kyazdani42/nvim-web-devicons :opt true}})
(use :junegunn/goyo.vim)
(use :Yggdroot/indentLine)
(use :ntpeters/vim-better-whitespace)
(use :valloric/matchtagalways)
; util
(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)
; others
(use :wakatime/vim-wakatime)
(use :rescript-lang/vim-rescript)
(use :otherjoel/vim-pollen)
(use {1 :kkoomen/vim-doge :run ":call doge#install()"})))

View File

@ -2,6 +2,10 @@
{require {nvim aniseed.nvim
nu aniseed.nvim.util}})
;; theme
(global github-theme (require :github-theme))
(github-theme.setup {:themeStyle :dark})
;; buffergator
(set nvim.g.buffergator_display_regime "parentdir")
@ -20,17 +24,42 @@
(nvim.set_keymap "" :sd "<Plug>(operator-surround-delete)" {:silent true})
(nvim.set_keymap "" :sr "<Plug>(operator-surround-replace)" {:silent true})
;; language-client neovim
;; (set nvim.g.LanguageClient_loggingFile "~/.config/nvim/lc.log")
(set nvim.g.LanguageClient_serverCommands
{:c ["ccls"]
:cpp ["ccls"]
:objc ["ccls"]
:objcpp ["ccls"]
:go ["gopls"]
:rust ["rls"]})
;; pollen
(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
(nvim.command "set completefunc=LanguageClient#complete")
(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})
\" Suggested editor settings:
\" autocmd FileType pollen setlocal wrap \" Soft wrap (don't affect buffer)
\" autocmd FileType pollen setlocal linebreak \" Wrap on word-breaks only
")
;; 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 :nightfly
: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 ["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,24 +1 @@
vim.g['aniseed#env'] = true
vim.g.polyglot_disabled = {"markdown", "javascript", "perl"}
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)
" autocmd FileType pollen setlocal linebreak " Wrap on word-breaks only
]])
require('plugins')
kommentary = require('kommentary.config')
kommentary.configure_language("default", {
prefer_single_line_comments = true,
})
kommentary.configure_language("objcpp", {
prefer_single_line_comments = true,
})

View File

@ -1,81 +0,0 @@
local packer = require('packer')
packer.init({
git = {
clone_timeout = 120, -- Timeout, in seconds, for git clones
}
})
packer.startup(function(use)
use 'wbthomason/packer.nvim'
use 'Olical/aniseed'
-- themes
use 'axvr/photon.vim'
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 'junegunn/goyo.vim'
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 'otherjoel/vim-pollen'
use {
'autozimu/LanguageClient-neovim',
branch = 'next',
run = 'bash install.sh'
}
use {
'kkoomen/vim-doge',
run = ':call doge#install()'
}
end)