update nvim config

This commit is contained in:
LordMZTE 2021-11-05 17:18:00 +01:00
parent 438a79330f
commit c4eeb91e62
12 changed files with 436 additions and 441 deletions

View file

@ -51,5 +51,6 @@
}
},
"java.format.enabled": true,
"java.format.onType.enabled": true
"java.format.onType.enabled": true,
"sumneko-lua.enableNvimLuaDev": true
}

View file

@ -1,4 +1,3 @@
require("plugins")
require("settings")
require("maps")

View file

@ -41,13 +41,13 @@ map("n", "<C-Down>", "5j", { noremap = true })
map("n", "<C-Up>", "5k", { noremap = true })
-- Quick pasting/yoinking to system register
map("n", "+y", "\"+y", { noremap = true })
map("n", "+p", "\"+p", { noremap = true })
map("n", "+d", "\"+d", { noremap = true })
map("n", "+y", '"+y', { noremap = true })
map("n", "+p", '"+p', { noremap = true })
map("n", "+d", '"+d', { noremap = true })
map("n", "*y", "\"*y", { noremap = true })
map("n", "*p", "\"*p", { noremap = true })
map("n", "*d", "\"*d", { noremap = true })
map("n", "*y", '"*y', { noremap = true })
map("n", "*p", '"*p', { noremap = true })
map("n", "*d", '"*d', { noremap = true })
map("i", "<TAB>", "v:lua.tab_completion()", { expr = true })
map("i", "<S-TAB>", "v:lua.shift_tab_completion()", { expr = true })
@ -66,13 +66,13 @@ map("n", "gi", "<Plug>(coc-implementation)", { silent = true })
map("n", "gr", "<Plug>(coc-references)", { silent = true })
-- Use K to show documentation in preview window.
map("n", "K", ":call CocActionAsync(\'doHover\')<CR>", { silent = true })
map("n", "K", ":call CocActionAsync('doHover')<CR>", { silent = true })
-- use space o to show symbols
map("n", "<space>o", ":CocList -I symbols<CR>", { silent = true })
-- format code
map("n", "-r", ":call CocActionAsync(\'format\')<CR>", { silent = true })
map("n", "-r", ":call CocActionAsync('format')<CR>", { silent = true })
-- Use <c-space> to trigger completion.
map("i", "<c-space>", "coc#refresh()", { silent = true, expr = true })

View file

@ -8,9 +8,9 @@ vim.g.coc_global_extensions = {
"coc-java",
"coc-json",
"coc-kotlin",
"coc-sumneko-lua",
"coc-rust-analyzer",
"coc-snippets",
"coc-sumneko-lua",
"coc-toml",
}

View file

@ -1,15 +1,14 @@
local blacklistedSites = {".*twitch\\.tv.*", ".*twitter\\.com.*"}
local blacklistedSites = { ".*twitch\\.tv.*", ".*twitter\\.com.*" }
local localSettings = {
[".*"] = {
cmdline = "neovim"
}
cmdline = "neovim",
},
}
for _, site in pairs(blacklistedSites) do
localSettings[site] = { takeover = "never" }
end
vim.g.firenvim_config = {
localSettings = localSettings
localSettings = localSettings,
}

View file

@ -13,7 +13,7 @@ gl.short_line_list = {
"nerdtree",
"fugitive",
"fugitiveblame",
"plug"
"plug",
}
-- VistaPlugin = extension.vista_nearest
@ -31,7 +31,7 @@ local colors = {
purple = "#bd93f9",
magenta = "#ff79c6",
blue = "#51afef",
red = "#ff5555"
red = "#ff5555",
}
local mode_color = {
@ -60,7 +60,7 @@ local mode_color = {
["r"] = colors.red,
rm = colors.red,
R = colors.yellow,
Rv = colors.magenta
Rv = colors.magenta,
}
local function lsp_status(status)
@ -137,8 +137,8 @@ gls.left[1] = {
provider = function()
return " "
end,
highlight = {colors.blue, colors.line_bg}
}
highlight = { colors.blue, colors.line_bg },
},
}
gls.left[2] = {
ViMode = {
@ -161,14 +161,14 @@ gls.left[2] = {
["r"] = "HIT-ENTER",
[""] = "SELECT",
t = "TERMINAL",
["!"] = "SHELL"
["!"] = "SHELL",
}
local vim_mode = vim.fn.mode()
vim.api.nvim_command("hi GalaxyViMode guibg=" .. mode_color[vim_mode])
return alias[vim_mode] .. ""
end,
highlight = {colors.line_bg, colors.line_bg, "bold"}
}
highlight = { colors.line_bg, colors.line_bg, "bold" },
},
}
gls.left[3] = {
ModeSep = {
@ -176,24 +176,24 @@ gls.left[3] = {
vim.api.nvim_command("hi GalaxyModeSep guifg=" .. mode_color[vim.fn.mode()] .. " guibg=" .. colors.bg)
return ""
end,
highlight = {colors.line_bg, colors.line_bg},
highlight = { colors.line_bg, colors.line_bg },
separator = "",
separator_highlight = {colors.bg, colors.line_bg}
}
separator_highlight = { colors.bg, colors.line_bg },
},
}
gls.left[4] = {
FileIcon = {
provider = "FileIcon",
condition = buffer_not_empty,
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.line_bg}
}
highlight = { require("galaxyline.provider_fileinfo").get_file_icon_color, colors.line_bg },
},
}
gls.left[5] = {
FileName = {
provider = {"FileName", "FileSize"},
provider = { "FileName", "FileSize" },
condition = buffer_not_empty,
highlight = {colors.fg, colors.line_bg, "bold"}
}
highlight = { colors.fg, colors.line_bg, "bold" },
},
}
gls.left[6] = {
@ -202,15 +202,15 @@ gls.left[6] = {
return ""
end,
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {colors.orange, colors.line_bg}
}
highlight = { colors.orange, colors.line_bg },
},
}
gls.left[7] = {
GitBranch = {
provider = "GitBranch",
condition = require("galaxyline.provider_vcs").check_git_workspace,
highlight = {"#8FBCBB", colors.line_bg, "bold"}
}
highlight = { "#8FBCBB", colors.line_bg, "bold" },
},
}
local checkwidth = function()
@ -226,79 +226,79 @@ gls.left[8] = {
provider = "DiffAdd",
condition = checkwidth,
icon = "",
highlight = {colors.green, colors.line_bg}
}
highlight = { colors.green, colors.line_bg },
},
}
gls.left[9] = {
DiffModified = {
provider = "DiffModified",
condition = checkwidth,
icon = "",
highlight = {colors.orange, colors.line_bg}
}
highlight = { colors.orange, colors.line_bg },
},
}
gls.left[10] = {
DiffRemove = {
provider = "DiffRemove",
condition = checkwidth,
icon = "",
highlight = {colors.red, colors.line_bg}
}
highlight = { colors.red, colors.line_bg },
},
}
gls.left[11] = {
LeftEnd = {
provider = function()
return ""
end,
highlight = {colors.line_bg, colors.bg},
}
highlight = { colors.line_bg, colors.bg },
},
}
gls.left[12] = {
TrailingWhiteSpace = {
provider = TrailingWhiteSpace,
icon = "",
highlight = {colors.yellow, colors.bg}
}
highlight = { colors.yellow, colors.bg },
},
}
gls.left[13] = {
DiagnosticError = {
provider = "DiagnosticError",
icon = "",
highlight = {colors.red, colors.bg}
}
highlight = { colors.red, colors.bg },
},
}
gls.left[14] = {
Space = {
provider = function()
return " "
end,
highlight = {colors.bg, colors.bg}
}
highlight = { colors.bg, colors.bg },
},
}
gls.left[15] = {
DiagnosticWarn = {
provider = "DiagnosticWarn",
icon = "",
highlight = {colors.yellow, colors.bg}
}
highlight = { colors.yellow, colors.bg },
},
}
gls.left[16] = {
CocStatus = {
provider = CocStatus,
highlight = {colors.green, colors.bg},
icon = " 🗱"
}
highlight = { colors.green, colors.bg },
icon = " 🗱",
},
}
gls.left[17] = {
CocFunc = {
provider = CocFunc,
icon = " λ ",
highlight = {colors.yellow, colors.bg}
}
highlight = { colors.yellow, colors.bg },
},
}
gls.right[1] = {
@ -306,9 +306,9 @@ gls.right[1] = {
provider = "FileTypeName",
separator = "",
condition = has_file_type,
separator_highlight = {colors.line_bg, colors.bg},
highlight = {colors.fg, colors.line_bg}
}
separator_highlight = { colors.line_bg, colors.bg },
highlight = { colors.fg, colors.line_bg },
},
}
gls.right[2] = {
@ -316,39 +316,39 @@ gls.right[2] = {
provider = function()
return ""
end,
highlight = {colors.bg, colors.line_bg}
}
highlight = { colors.bg, colors.line_bg },
},
}
gls.right[3] = {
FileFormat = {
provider = "FileFormat",
separator = "",
separator_highlight = {colors.line_bg, colors.bg},
highlight = {colors.fg, colors.line_bg, "bold"}
}
separator_highlight = { colors.line_bg, colors.bg },
highlight = { colors.fg, colors.line_bg, "bold" },
},
}
gls.right[4] = {
LineInfo = {
provider = "LineColumn",
separator = " |",
separator_highlight = {colors.blue, colors.line_bg},
highlight = {colors.fg, colors.line_bg}
}
separator_highlight = { colors.blue, colors.line_bg },
highlight = { colors.fg, colors.line_bg },
},
}
gls.right[5] = {
PerCent = {
provider = "LinePercent",
highlight = {colors.cyan, colors.darkblue, "bold"}
}
highlight = { colors.cyan, colors.darkblue, "bold" },
},
}
gls.right[6] = {
ScrollBar = {
provider = 'ScrollBar',
highlight = {colors.blue,colors.purple},
}
provider = "ScrollBar",
highlight = { colors.blue, colors.purple },
},
}
gls.short_line_left[1] = {
@ -356,9 +356,9 @@ gls.short_line_left[1] = {
provider = "FileTypeName",
separator = "",
condition = has_file_type,
separator_highlight = {colors.purple, colors.bg},
highlight = {colors.fg, colors.purple}
}
separator_highlight = { colors.purple, colors.bg },
highlight = { colors.fg, colors.purple },
},
}
gls.short_line_right[1] = {
@ -366,8 +366,7 @@ gls.short_line_right[1] = {
provider = "BufferIcon",
separator = "",
condition = has_file_type,
separator_highlight = {colors.purple, colors.bg},
highlight = {colors.fg, colors.purple}
}
separator_highlight = { colors.purple, colors.bg },
highlight = { colors.fg, colors.purple },
},
}

View file

@ -1,7 +1,7 @@
local pears = require "pears"
local pears = require("pears")
pears.setup(function(conf)
conf.preset "tag_matching"
conf.preset("tag_matching")
conf.on_enter(function(pears_handle)
if vim.fn.pumvisible() == 1 then
@ -11,4 +11,3 @@ pears.setup(function(conf)
end
end)
end)

View file

@ -1,4 +1,4 @@
require 'nvim-tree'.setup {
require("nvim-tree").setup({
-- don't open tree when using firenvim
open_on_setup = not vim.g.started_by_firenvim,
auto_close = true,
@ -8,5 +8,4 @@ require 'nvim-tree'.setup {
view = {
auto_resize = true,
},
}
})

View file

@ -1,13 +1,13 @@
require("telescope").setup {
require("telescope").setup({
defaults = {
vimgrep_arguments = {
'rg',
'--color=never',
'--no-heading',
'--with-filename',
'--line-number',
'--column',
'--smart-case'
}
}
}
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
},
})

View file

@ -1,21 +1,20 @@
local configs = require "nvim-treesitter.configs"
local parsers = require "nvim-treesitter.parsers"
local configs = require("nvim-treesitter.configs")
local parsers = require("nvim-treesitter.parsers")
local parser_config = parsers.get_parser_configs()
parser_config.haxe = {
install_info = {
url = "https://github.com/vantreeseba/tree-sitter-haxe",
files = {"src/parser.c"},
branch = "main"
files = { "src/parser.c" },
branch = "main",
},
filetype = "haxe"
filetype = "haxe",
}
configs.setup {
configs.setup({
ensure_installed = { "haxe" },
highlight = {
enable = true
}
}
enable = true,
},
})

View file

@ -1,79 +1,80 @@
vim.cmd [[packadd packer.nvim]]
vim.cmd([[packadd packer.nvim]])
local function pconf(plugin)
return "require(\"pluginconf." .. plugin .. "\")"
return 'require("pluginconf.' .. plugin .. '")'
end
return require("packer").startup(function(use)
use "wbthomason/packer.nvim"
use("wbthomason/packer.nvim")
use {
use({
"neoclide/coc.nvim",
branch = "release",
config = pconf("coc")
}
use "ryanoasis/vim-devicons"
use {
config = pconf("coc"),
})
use("ryanoasis/vim-devicons")
use({
"cespare/vim-toml",
branch = "main"
}
use {
branch = "main",
})
use({
"dracula/vim",
as = "dracula"
}
use "vimwiki/vimwiki"
use {
as = "dracula",
})
use("vimwiki/vimwiki")
use({
"glacambre/firenvim",
run = function() vim.fn["firenvim#install"](0) end,
config = pconf("firenvim")
}
use "airblade/vim-gitgutter"
use "dag/vim-fish"
use "uiiaoo/java-syntax.vim"
use "honza/vim-snippets"
use "sheerun/vim-polyglot"
use {
run = function()
vim.fn["firenvim#install"](0)
end,
config = pconf("firenvim"),
})
use("airblade/vim-gitgutter")
use("dag/vim-fish")
use("uiiaoo/java-syntax.vim")
use("honza/vim-snippets")
use("sheerun/vim-polyglot")
use({
"glepnir/galaxyline.nvim",
branch = "main",
config = pconf("galaxyline")
}
use {
config = pconf("galaxyline"),
})
use({
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
config = pconf("treesitter")
}
use {
config = pconf("treesitter"),
})
use({
"euclio/vim-markdown-composer",
run = "cargo build --release",
config = pconf("markdowncomposer")
}
config = pconf("markdowncomposer"),
})
use "kassio/neoterm"
use("kassio/neoterm")
use "kyazdani42/nvim-web-devicons"
use("kyazdani42/nvim-web-devicons")
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
config = pconf("nvimtree")
}
use({
"kyazdani42/nvim-tree.lua",
requires = "kyazdani42/nvim-web-devicons",
config = pconf("nvimtree"),
})
use {
use({
"TimUntersberger/neogit",
requires = "nvim-lua/plenary.nvim"
}
requires = "nvim-lua/plenary.nvim",
})
use "ron-rs/ron.vim"
use("ron-rs/ron.vim")
use {
use({
"nvim-telescope/telescope.nvim",
requires = "nvim-lua/plenary.nvim",
config = pconf("telescope")
}
use "gluon-lang/vim-gluon"
use {
config = pconf("telescope"),
})
use("gluon-lang/vim-gluon")
use({
"steelsojka/pears.nvim",
config = pconf("nvim_pears")
}
config = pconf("nvim_pears"),
})
end)

View file

@ -27,4 +27,3 @@ cmd("autocmd CursorHold * silent call CocActionAsync('highlight')")
cmd("autocmd StdinReadPre * let s:std_in=1")
cmd("filetype plugin on")