Compare commits

...

24 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
5 changed files with 102 additions and 32 deletions

View File

@ -63,6 +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") (require "lsp")

View File

@ -1,21 +1,59 @@
(module user.lsp (module user.lsp
{require {nvim aniseed.nvim}}) {require {nvim aniseed.nvim}})
(global lspconfig (require :lspconfig)) (local lspconfig (require :lspconfig))
(global treesitter (require :nvim-treesitter.configs)) (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 "" :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 "" :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 "" :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 "" :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 "" :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.rust_analyzer.setup {})
(lspconfig.gopls.setup {}) (lspconfig.gopls.setup {})
(lspconfig.denols.setup {}) (lspconfig.hls.setup {
:cmd ["haskell-language-server-wrapper" "--lsp" "--logfile" "/home/r00t/.cache/nvim/hls.log" "--debug"]
})
(treesitter.setup {:ensure_installed ["c" "cpp" "python" "go" "rust" "javascript" "lua"] ; treesitter
(set treesitter_install.compilers ["clang"])
(treesitter_configs.setup {:ensure_installed ["c" "cpp" "python" "go" "rust" "javascript" "typescript" "lua"]
:highlight {:enable true} :highlight {:enable true}
:indent {: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"}}}})
(set nvim.o.completeopt "menuone,noselect") ;; 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})

View File

@ -7,30 +7,48 @@
(use :Olical/aniseed) ; fennel to lua (use :Olical/aniseed) ; fennel to lua
; themes ; themes
(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 :lukas-reineke/indent-blankline.nvim)
(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 ":TSUpdate"}) (use {
(use :hrsh7th/nvim-compe) 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) (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 {1 :kkoomen/vim-doge :run ":call doge#install()"}))) (use {1 :kkoomen/vim-doge :run ":call doge#install()"})))

View File

@ -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,10 +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 :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 ;; kommentary
(global kommentary (require :kommentary.config)) (global kommentary (require :kommentary.config))
@ -32,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}
@ -42,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 {}

View File

@ -3,7 +3,8 @@
local fn = vim.fn local fn = vim.fn
local execute = vim.api.nvim_command local execute = vim.api.nvim_command
if fn.empty(fn.glob(fn.stdpath('data')..'/site/pack/packer/start/')) > 0 then bootstrap = fn.empty(fn.glob(fn.stdpath('data')..'/site/pack/packer/start/')) > 0
if bootstrap then
local github = 'https://github.com/' local github = 'https://github.com/'
local packer_git = github..'wbthomason/packer.nvim' local packer_git = github..'wbthomason/packer.nvim'
local aniseed_git = github..'Olical/aniseed' local aniseed_git = github..'Olical/aniseed'
@ -12,6 +13,13 @@ if fn.empty(fn.glob(fn.stdpath('data')..'/site/pack/packer/start/')) > 0 then
local packer_path = install_path..'packer.nvim' local packer_path = install_path..'packer.nvim'
local aniseed_path = install_path..'aniseed' 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', packer_git, packer_path})
fn.system({'git', 'clone', aniseed_git, aniseed_path}) fn.system({'git', 'clone', aniseed_git, aniseed_path})
@ -21,12 +29,6 @@ if fn.empty(fn.glob(fn.stdpath('data')..'/site/pack/packer/start/')) > 0 then
-- load only plugins to install plugins -- load only plugins to install plugins
require('aniseed.env').init({compile = true, module = 'plugins'}) require('aniseed.env').init({compile = true, module = 'plugins'})
execute 'PackerUpdate' execute 'PackerUpdate'
print('Plugins are installed, but config is not fully loaded, please open Neovim again')
else else
-- call through aniseed
vim.g['aniseed#env'] = true vim.g['aniseed#env'] = true
end end