summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2024-01-05 17:47:19 +0100
committerache <ache@ache.one>2024-01-05 17:47:19 +0100
commit11b0d812e6b8cfd5383bdba3c7129dceadb6f749 (patch)
treebf96de61c20f978aee15c94bb04222f3e2767d1f
parentConfig to use tabby (diff)
Switch to Lazy.lua
-rwxr-xr-xpack/ache/start/installPlugin.py149
-rwxr-xr-xpack/ache/start/updatePlugin.py30
-rw-r--r--plugin/init.lua271
3 files changed, 256 insertions, 194 deletions
diff --git a/pack/ache/start/installPlugin.py b/pack/ache/start/installPlugin.py
deleted file mode 100755
index 16669c5..0000000
--- a/pack/ache/start/installPlugin.py
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/env python
-
-import subprocess
-
-
-list_of_plugins = [
-
-# ale
-#
-# Check for error and format. 👍
- "https://github.com/dense-analysis/ale.git",
-
-# coc.nvim
-#
-# A powerfull completion system based on LSP
- ("https://github.com/neoclide/coc.nvim.git", "release"),
-
-# leap.nvim
-#
-# A powerfull visual movement system
- "https://github.com/ggandor/leap.nvim",
-
-
-# A good status line
- "https://github.com/vim-airline/vim-airline",
-
-# ☠️ Vimspector
-#
-# Integrate gdb inside vim
-# "https://github.com/puremourning/vimspector",
-
-# nvim-tree.lua
-#
-# A smart and light file browser
- "https://github.com/kyazdani42/nvim-tree.lua",
-
-# gen_tags.vim
-#
-# To generate tag for C based languages
-# "https://github.com/jsfaint/gen_tags.vim",
-
-# hexmode
-#
-# Switch to Hexmode with xxd, not very usefull
- "https://github.com/fidian/hexmode.git",
-
-# Git integration
-#
-# "https://github.com/tpope/vim-fugitive",
-
-# Use "cs" to modified a surround character
-"https://github.com/tpope/vim-surround",
-# Color matching parentheses
-"https://github.com/junegunn/rainbow_parentheses.vim",
-
-# Quick comment/uncomment with "gcc"
-#
-"https://github.com/tpope/vim-commentary",
-
-# Fix the repeat map, not usefull
-# "https://github.com/tpope/vim-repeat"
-
-
-# Powerfull align tool, hard to remember
- "https://github.com/godlygeek/tabular",
-
-# A dark colorscheme
- "https://github.com/sjl/badwolf",
-# A lighter dark colorscheme
- "https://github.com/nanotech/jellybeans.vim",
-# A colection of colorschemes
- "https://github.com/lithammer/vim-eighties",
-
-# Fuzzy search and ripgrep integration
- "https://github.com/junegunn/fzf.vim",
- "https://github.com/junegunn/fzf",
-
-# A color integration that is beautifull and quick
- "https://github.com/RRethy/vim-hexokinase",
-
-# Display registers content as auto completion 👍
- "https://github.com/tversteeg/registers.nvim",
-
-# Rename XML open/close tag when the other one is modified
- "https://github.com/AndrewRadev/tagalong.vim",
-
-# Grammalecte
-#
-# French corrector integration
- "https://github.com/dpelle/vim-Grammalecte",
-
-# Neovim in Firefox
-# "https://github.com/glacambre/firenvim"
-
-# List of snippets
- "https://github.com/honza/vim-snippets",
-
-# Add cscope function to neovim
- "https://github.com/dhananjaylatkar/cscope_maps.nvim",
-
-
-# Language specific support
- "https://github.com/jparise/vim-graphql",
- "https://github.com/rust-lang/rust.vim",
- "https://github.com/hail2u/vim-css3-syntax",
- "https://github.com/pangloss/vim-javascript",
- "https://github.com/khaveesh/vim-fish-syntax",
- "https://github.com/fatih/vim-go",
- "https://github.com/moll/vim-node",
- "https://github.com/evanleck/vim-svelte"
-]
-
-list_coc_plugins = [
-# C based support
- "coc-clangd",
-# JS support
- "coc-svelte",
- "coc-tsserver",
- "coc-deno",
-# Python support
- "coc-pyright",
-# Web support
- "coc-html",
- "coc-css",
-# Various snippets
- "coc-snippets"
-]
-
-for plugin in list_of_plugins:
- if type(plugin) is tuple:
- subprocess.run(["git", "clone", "--branch", plugin[1], plugin[0], "--depth=1"])
- else:
- subprocess.run(["git", "clone", plugin, "--depth=1"])
-
-# Post install script
-
-with open('rainbow_parentheses.vim/plugin/rainbow_parentheses.vim', 'a') as f:
- f.write('\n:RainbowParentheses\n')
-print('Post install Rainbow Parentheses done ✔️')
-
-subprocess.run(["make", "hexokinase"], cwd="vim-hexokinase")
-print('Post install Hexakinase done ✔️')
-
-installCmd = f"+:CocInstall {' '.join(list_coc_plugins)}"
-subprocess.run(["nvim", installCmd])
-print('Coc plugins install done ✔️')
-
-print("Please check health 🏥")
-subprocess.run(["nvim", "+:checkhealth"])
diff --git a/pack/ache/start/updatePlugin.py b/pack/ache/start/updatePlugin.py
deleted file mode 100755
index 2a8a496..0000000
--- a/pack/ache/start/updatePlugin.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/env python
-
-import subprocess
-from pathlib import Path
-
-
-for plugin in Path('.').iterdir():
- if (plugin / ".git").exists():
- ret = subprocess.run(["git", "pull"], cwd=str(plugin))
-
- if ret.returncode != 0:
- print(f"Error updating {plugin}")
- continue
-
- # The option --init is necessery if there is new submodule
- ret = subprocess.run(["git", "submodule", "update", "--init", "--recursive"], cwd=str(plugin))
- if ret.returncode != 0:
- print(f"Error updating {plugin}")
-
-# Post install script
-
-subprocess.run(["make", "hexokinase"], cwd="vim-hexokinase")
-print('Post install Hexakinase done ✔️')
-
-installCmd = "+:CocUpdate"
-subprocess.run(["nvim", installCmd])
-print('Coc plugins update done ✔️')
-
-print("Please check health 🏥")
-subprocess.run(["nvim", "+:checkhealth"])
diff --git a/plugin/init.lua b/plugin/init.lua
index 90f41f5..9d7e2b0 100644
--- a/plugin/init.lua
+++ b/plugin/init.lua
@@ -1,3 +1,86 @@
+--[[
+ This is the first neovim configuration file.
+
+ It in fact load lazy vim first.
+--]]
+
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+
+if not vim.loop.fs_stat(lazypath) then
+ vim.fn.system({
+ "git",
+ "clone",
+ "--filter=blob:none",
+ "https://github.com/folke/lazy.nvim.git",
+ "--branch=stable", -- latest stable release
+ lazypath,
+ })
+end
+vim.opt.rtp:prepend(lazypath)
+
+
+require("lazy").setup({
+ "https://github.com/vim-airline/vim-airline",
+ "https://github.com/ggandor/leap.nvim",
+ "https://github.com/junegunn/fzf",
+ "https://github.com/junegunn/fzf.vim",
+ "https://github.com/dpelle/vim-Grammalecte",
+ "https://github.com/dense-analysis/ale.git",
+ "https://github.com/nvim-treesitter/nvim-treesitter", -- Syntax LSP
+ "https://github.com/neoclide/coc.nvim.git",
+ "https://github.com/kyazdani42/nvim-tree.lua", -- File explorer
+ "https://github.com/fidian/hexmode.git",
+ "https://github.com/tpope/vim-surround",
+ "https://github.com/godlygeek/tabular",
+ "https://github.com/AndrewRadev/tagalong.vim",
+ "https://github.com/MunifTanjim/nui.nvim",
+ "https://github.com/jparise/vim-graphql",
+ "https://github.com/rust-lang/rust.vim",
+ "https://github.com/hail2u/vim-css3-syntax",
+ "https://github.com/tmhedberg/SimpylFold",
+ "https://github.com/pangloss/vim-javascript",
+ "https://github.com/khaveesh/vim-fish-syntax",
+ "https://github.com/moll/vim-node",
+ "https://github.com/evanleck/vim-svelte",
+ "https://github.com/ray-x/go.nvim",
+ "https://github.com/kyazdani42/nvim-tree.lua",
+ "https://github.com/junegunn/rainbow_parentheses.vim",
+ "https://github.com/nanotech/jellybeans.vim",
+ "https://github.com/honza/vim-snippets",
+ "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
+ "https://github.com/ray-x/starry.nvim",
+ "https://github.com/nvim-tree/nvim-web-devicons",
+ "https://github.com/nvim-lua/plenary.nvim",
+ "https://github.com/andymass/vim-matchup",
+ "KostkaBrukowa/definition-or-references.nvim",
+ "ray-x/go.nvim",
+ "FabijanZulj/blame.nvim",
+ {
+ "tversteeg/registers.nvim",
+ cmd = "Registers",
+ config = true,
+ keys = {
+ { "\"", mode = { "n", "v" } },
+ { "<C-R>", mode = "i" }
+ },
+ name = "registers",
+ },
+ dependencies = { -- optional packages
+ "ray-x/guihua.lua",
+ "neovim/nvim-lspconfig",
+ "nvim-treesitter/nvim-treesitter",
+ },
+ config = function()
+ require("go").setup()
+ end,
+ event = {"CmdlineEnter"},
+ ft = {"go", 'gomod'},
+ build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
+})
+
+
+require('leap').set_default_keymaps()
+
-- Nvim-tree keymap function
local function my_on_attach(bufnr)
local api = require('nvim-tree.api')
@@ -52,23 +135,181 @@ require("nvim-tree").setup({
},
})
-vim.g.nvim_tree_respect_buf_cwd = 1
+vim.g.nvim_tree_respect_buf_cwd = 1
--- Others setup
-require('leap').set_default_keymaps()
--- require("cscope_maps").setup({})
---
--- vim.keymap.set('i', '<m-x>', function () return vim.fn['codeium#Complete']() end, { expr = true })
-
-vim.keymap.set('i', '<m-x>', function ()
- -- Check if codeium#Complete is available
- if vim.g.codeium_enabled_toggle == "on" then
- return vim.fn['codeium#Complete']()
- end
-end, { expr = true })
+vim.g.tabby_node_binary = '/usr/bin/node'
+--[[
+require('go').setup({
+ disable_defaults = false, -- true|false when true set false to all boolean settings and replace all table
+ -- settings with {}
+ go='go', -- go command, can be go[default] or go1.18beta1
+ goimport='gofumpt', -- goimport command, can be gopls[default] or either goimport or golines if need to split long lines
+ fillstruct = 'fillstruct', -- default, can also use fillstruct
+ gofmt = 'gofumpt', --gofmt cmd,
+ max_line_len = 128, -- max line length in golines format, Target maximum line length for golines
+ tag_transform = false, -- can be transform option("snakecase", "camelcase", etc) check gomodifytags for details and more options
+ tag_options = 'json=omitempty', -- sets options sent to gomodifytags, i.e., json=omitempty
+ gotests_template = "", -- sets gotests -template parameter (check gotests for details)
+ gotests_template_dir = "", -- sets gotests -template_dir parameter (check gotests for details)
+ comment_placeholder = '' , -- comment_placeholder your cool placeholder e.g. 󰟓    
+ icons = {breakpoint = '🧘', currentpos = '🏃'}, -- setup to `false` to disable icons setup
+ verbose = false, -- output loginf in messages
+ lsp_cfg = false, -- true: use non-default gopls setup specified in go/lsp.lua
+ -- false: do nothing
+ -- if lsp_cfg is a table, merge table with with non-default gopls setup in go/lsp.lua, e.g.
+ -- lsp_cfg = {settings={gopls={matcher='CaseInsensitive', ['local'] = 'your_local_module_path', gofumpt = true }}}
+ lsp_gofumpt = true, -- true: set default gofmt in gopls format to gofumpt
+ lsp_on_attach = nil, -- nil: use on_attach function defined in go/lsp.lua,
+ -- when lsp_cfg is true
+ -- if lsp_on_attach is a function: use this function as on_attach function for gopls
+ lsp_keymaps = true, -- set to false to disable gopls/lsp keymap
+ lsp_codelens = true, -- set to false to disable codelens, true by default, you can use a function
+ -- function(bufnr)
+ -- vim.api.nvim_buf_set_keymap(bufnr, "n", "<space>F", "<cmd>lua vim.lsp.buf.formatting()<CR>", {noremap=true, silent=true})
+ -- end
+ -- to setup a table of codelens
+ diagnostic = { -- set diagnostic to false to disable vim.diagnostic setup
+ hdlr = false, -- hook lsp diag handler and send diag to quickfix
+ underline = true,
+ -- virtual text setup
+ virtual_text = { spacing = 0, prefix = '■' },
+ signs = true,
+ update_in_insert = false,
+ },
+ lsp_document_formatting = false,
+ -- set to true: use gopls to format
+ -- false if you want to use other formatter tool(e.g. efm, nulls)
+ lsp_inlay_hints = {
+ enable = true,
+ -- hint style, set to 'eol' for end-of-line hints, 'inlay' for inline hints
+ -- inlay only avalible for 0.10.x
+ style = 'inlay',
+ -- Note: following setup only works for style = 'eol', you do not need to set it for 'inlay'
+ -- Only show inlay hints for the current line
+ only_current_line = false,
+ -- Event which triggers a refersh of the inlay hints.
+ -- You can make this "CursorMoved" or "CursorMoved,CursorMovedI" but
+ -- not that this may cause higher CPU usage.
+ -- This option is only respected when only_current_line and
+ -- autoSetHints both are true.
+ only_current_line_autocmd = "CursorHold",
+ -- whether to show variable name before type hints with the inlay hints or not
+ -- default: false
+ show_variable_name = true,
+ -- prefix for parameter hints
+ parameter_hints_prefix = "󰊕 ",
+ show_parameter_hints = true,
+ -- prefix for all the other hints (type, chaining)
+ other_hints_prefix = "=> ",
+ -- whether to align to the lenght of the longest line in the file
+ max_len_align = false,
+ -- padding from the left if max_len_align is true
+ max_len_align_padding = 1,
+ -- whether to align to the extreme right or not
+ right_align = false,
+ -- padding from the right if right_align is true
+ right_align_padding = 6,
+ -- The color of the hints
+ highlight = "Comment",
+ },
+ gopls_cmd = "gofumpt", -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile","/var/log/gopls.log" }
+ gopls_remote_auto = true, -- add -remote=auto to gopls
+ gocoverage_sign = "█",
+ sign_priority = 5, -- change to a higher number to override other signs
+ dap_debug = true, -- set to false to disable dap
+ dap_debug_keymap = true, -- true: use keymap for debugger defined in go/dap.lua
+ -- false: do not use keymap in go/dap.lua. you must define your own.
+ -- Windows: Use Visual Studio keymap
+ dap_debug_gui = {}, -- bool|table put your dap-ui setup here set to false to disable
+ dap_debug_vt = { enabled_commands = true, all_frames = true }, -- bool|table put your dap-virtual-text setup here set to false to disable
-vim.g.codeium_manual = true
+ dap_port = 38697, -- can be set to a number, if set to -1 go.nvim will pick up a random port
+ dap_timeout = 15, -- see dap option initialize_timeout_sec = 15,
+ dap_retries = 20, -- see dap option max_retries
+ build_tags = "tag1,tag2", -- set default build tags
+ textobjects = true, -- enable default text jobects through treesittter-text-objects
+ test_runner = 'go', -- one of {`go`, `richgo`, `dlv`, `ginkgo`, `gotestsum`}
+ verbose_tests = true, -- set to add verbose flag to tests deprecated, see '-v' option
+ run_in_floaterm = false, -- set to true to run in a float window. :GoTermClose closes the floatterm
+ -- float term recommend if you use richgo/ginkgo with terminal color
-vim.g.tabby_node_binary = '/usr/bin/node'
+ floaterm = { -- position
+ posititon = 'auto', -- one of {`top`, `bottom`, `left`, `right`, `center`, `auto`}
+ width = 0.45, -- width of float window if not auto
+ height = 0.98, -- height of float window if not auto
+ title_colors = 'nord', -- default to nord, one of {'nord', 'tokyo', 'dracula', 'rainbow', 'solarized ', 'monokai'}
+ -- can also set to a list of colors to define colors to choose from
+ -- e.g {'#D8DEE9', '#5E81AC', '#88C0D0', '#EBCB8B', '#A3BE8C', '#B48EAD'}
+ },
+ trouble = false, -- true: use trouble to open quickfix
+ test_efm = false, -- errorfomat for quickfix, default mix mode, set to true will be efm only
+ luasnip = false, -- enable included luasnip snippets. you can also disable while add lua/snips folder to luasnip load
+ -- Do not enable this if you already added the path, that will duplicate the entries
+ on_jobstart = function(cmd) _=cmd end, -- callback for stdout
+ on_stdout = function(err, data) _, _ = err, data end, -- callback when job started
+ on_stderr = function(err, data) _, _ = err, data end, -- callback for stderr
+ on_exit = function(code, signal, output) _, _, _ = code, signal, output end, -- callback for jobexit, output : string
+ iferr_vertical_shift = 4 -- defines where the cursor will end up vertically from the begining of if err statement
+})
+
+local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
+vim.api.nvim_create_autocmd("BufWritePre", {
+ pattern = "*.go",
+ callback = function()
+ require('go.format')
+ end,
+ group = format_sync_grp,
+})
+
+--]]
+
+-- Init starry colorsheme
+local config = {
+ border = false, -- Split window borders
+ italics = {
+ comments = false, -- Italic comments
+ strings = false, -- Italic strings
+ keywords = false, -- Italic keywords
+ functions = false, -- Italic functions
+ variables = false -- Italic variables
+ },
+
+ contrast = { -- Select which windows get the contrast background
+ enable = true, -- Enable contrast
+ terminal = true, -- Darker terminal
+ filetypes = {}, -- Which filetypes get darker? e.g. *.vim, *.cpp, etc.
+ },
+
+ text_contrast = {
+ lighter = false, -- Higher contrast text for lighter style
+ darker = false -- Higher contrast text for darker style
+ },
+
+ disable = {
+ background = false, -- true: transparent background
+ term_colors = false, -- Disable setting the terminal colors
+ eob_lines = false -- Make end-of-buffer lines invisible
+ },
+
+ style = {
+ name = 'moonlight', -- Theme style name (moonlight, earliestsummer, etc.)
+ -- " other themes: dracula, oceanic, dracula_blood, 'deep ocean', darker, palenight, monokai, mariana, emerald, middlenight_blue
+ disable = {}, -- a list of styles to disable, e.g. {'bold', 'underline'}
+ fix = true,
+ darker_contrast = false, -- More contrast for darker style
+ daylight_swith = false, -- Enable day and night style switching
+ deep_black = false, -- Enable a deeper black background
+ },
+
+ custom_colors = {
+ variable = '#f797d7',
+ },
+ custom_highlights = {
+ LineNr = { fg = '#777777' },
+ Idnetifier = { fg = '#ff4797' },
+ }
+}
+require('starry').setup(config)
+require('starry.functions').change_style("dracula")