From 1de9b47d921b7a85070aec8c05ed6ab7b3979c6e Mon Sep 17 00:00:00 2001 From: nganhkhoa Date: Fri, 9 Jul 2021 21:05:30 +0000 Subject: [PATCH] update --- .gitignore | 2 -- README.md | 21 +++++++++++-- fnl/init.fnl | 3 +- fnl/plugins.fnl | 35 +++++++++++++++++++++ fnl/settings.fnl | 55 ++++++++++++++++++++++++-------- init.lua | 23 -------------- lua/plugins.lua | 81 ------------------------------------------------ 7 files changed, 97 insertions(+), 123 deletions(-) create mode 100644 fnl/plugins.fnl delete mode 100644 lua/plugins.lua diff --git a/.gitignore b/.gitignore index 308c6b9..04b9be7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ lc.log lua/*.lua -!lua/plugins.lua - plugin/ diff --git a/README.md b/README.md index c572a05..d200dd4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/fnl/init.fnl b/fnl/init.fnl index 77f1092..d2ebd77 100644 --- a/fnl/init.fnl +++ b/fnl/init.fnl @@ -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") diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl new file mode 100644 index 0000000..f06acc7 --- /dev/null +++ b/fnl/plugins.fnl @@ -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()"}))) diff --git a/fnl/settings.fnl b/fnl/settings.fnl index 788f308..4168cc5 100644 --- a/fnl/settings.fnl +++ b/fnl/settings.fnl @@ -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 "(operator-surround-delete)" {:silent true}) (nvim.set_keymap "" :sr "(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 "(lcn-definition)" {:silent true}) -(nvim.set_keymap "" :gh "(lcn-hover)" {:silent true}) -(nvim.set_keymap "" :gr "(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"]}) diff --git a/init.lua b/init.lua index 5f26a5a..d020379 100644 --- a/init.lua +++ b/init.lua @@ -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, -}) diff --git a/lua/plugins.lua b/lua/plugins.lua deleted file mode 100644 index 006a9b0..0000000 --- a/lua/plugins.lua +++ /dev/null @@ -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)