Some more improvements to the Neovim config
This commit is contained in:
parent
18a49d5d67
commit
335d45d9cb
11 changed files with 68 additions and 66 deletions
|
@ -1,14 +1,7 @@
|
||||||
{
|
{
|
||||||
"eslint.filetypes": [
|
|
||||||
"javascript",
|
|
||||||
"typescript",
|
|
||||||
"typescriptreact",
|
|
||||||
"javascriptreact",
|
|
||||||
"typescript.tsx"
|
|
||||||
],
|
|
||||||
"diagnostic.refreshOnInsertMode": true,
|
"diagnostic.refreshOnInsertMode": true,
|
||||||
"coc.preferences.formatOnSaveFiletypes": ["*"],
|
"coc.preferences.formatOnSaveFiletypes": ["*"],
|
||||||
"Lua.telemetry.enable": false,
|
"Lua.telemetry.enable": false,
|
||||||
"sumneko-lua.enableNvimLuaDev": true,
|
"sumneko-lua.enableNvimLuaDev": true,
|
||||||
"coc.preferences.diagnostic.virtualText": true
|
"diagnostic.virtualText": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
local keymap = vim.api.nvim_set_keymap
|
local keymap = vim.keymap.set
|
||||||
local expr_opts = { noremap = true, silent = true, expr = true}
|
local expr_opts = { replace_keycodes = false, expr = true }
|
||||||
|
|
||||||
|
vim.diagnostic.config { virtual_text = true }
|
||||||
|
|
||||||
keymap(
|
keymap(
|
||||||
"i",
|
"i",
|
||||||
|
|
|
@ -3,7 +3,7 @@ local db = require('dashboard')
|
||||||
db.hide_tabline = false
|
db.hide_tabline = false
|
||||||
db.custom_center = {
|
db.custom_center = {
|
||||||
{ icon = ' ',
|
{ icon = ' ',
|
||||||
desc = 'Recently latest session ',
|
desc = 'Latest Session ',
|
||||||
shortcut = '',
|
shortcut = '',
|
||||||
action = 'OpenSession' },
|
action = 'OpenSession' },
|
||||||
{ icon = ' ',
|
{ icon = ' ',
|
||||||
|
|
7
config/nvim/lua/config/lsp.lua
Normal file
7
config/nvim/lua/config/lsp.lua
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
local lsp = require('lsp-zero')
|
||||||
|
lsp.preset('recommended')
|
||||||
|
lsp.nvim_workspace()
|
||||||
|
lsp.setup()
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = true,
|
||||||
|
})
|
|
@ -1,3 +0,0 @@
|
||||||
local saga = require('lspsaga')
|
|
||||||
|
|
||||||
saga.init_lsp_saga()
|
|
12
config/nvim/lua/config/novim.lua
Normal file
12
config/nvim/lua/config/novim.lua
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
|
keymap("i", "<A-;>", "<C-O>:")
|
||||||
|
keymap("i", "<C-q>", vim.cmd.quitall)
|
||||||
|
keymap("i", "<C-s>", function()
|
||||||
|
local exit = os.execute("test -w " .. vim.fn.expand("%:p"))
|
||||||
|
if exit == 0 then
|
||||||
|
vim.cmd.write()
|
||||||
|
else
|
||||||
|
vim.cmd.SudaWrite()
|
||||||
|
end
|
||||||
|
end)
|
|
@ -1,5 +1,4 @@
|
||||||
local opts = { noremap = true, silent = true}
|
local keymap = vim.keymap.set
|
||||||
local keymap = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
local nvimtree = require("nvim-tree")
|
local nvimtree = require("nvim-tree")
|
||||||
|
|
||||||
|
@ -13,4 +12,4 @@ nvimtree.setup({
|
||||||
})
|
})
|
||||||
|
|
||||||
-- open file tree
|
-- open file tree
|
||||||
keymap("i", "<C-e>", "<cmd>:NvimTreeToggle<CR>", opts)
|
keymap("i", "<A-e>", "<cmd>:NvimTreeToggle<CR>")
|
||||||
|
|
|
@ -1,5 +1,2 @@
|
||||||
local keymap = vim.api.nvim_set_keymap
|
|
||||||
local opts = { noremap = true, silent = true}
|
|
||||||
|
|
||||||
local toggleterm = require("toggleterm")
|
local toggleterm = require("toggleterm")
|
||||||
toggleterm.setup{open_mapping = [[<C-Space>]]}
|
toggleterm.setup { open_mapping = [[<C-Space>]], direction = "float" }
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
vim.g.novim_mode_use_general_app_shortcuts = 0
|
||||||
vim.g.session_lock_enabled = 0
|
vim.g.session_lock_enabled = 0
|
||||||
vim.g.session_autosave = 'yes'
|
vim.g.session_autosave = 'yes'
|
||||||
vim.g.sudo_smart_edit = 1
|
vim.g.sudo_smart_edit = 1
|
||||||
|
|
|
@ -6,7 +6,7 @@ end
|
||||||
|
|
||||||
return packer.startup({ function(use)
|
return packer.startup({ function(use)
|
||||||
-- Utility
|
-- Utility
|
||||||
use 'tombh/novim-mode'
|
use { 'tombh/novim-mode', config = config("novim") }
|
||||||
use { 'akinsho/toggleterm.nvim', config = config("toggleterm") }
|
use { 'akinsho/toggleterm.nvim', config = config("toggleterm") }
|
||||||
use 'tpope/vim-sleuth'
|
use 'tpope/vim-sleuth'
|
||||||
use {
|
use {
|
||||||
|
@ -34,8 +34,7 @@ return packer.startup({ function(use)
|
||||||
use 'kyazdani42/nvim-web-devicons'
|
use 'kyazdani42/nvim-web-devicons'
|
||||||
|
|
||||||
-- Completion/Linting
|
-- Completion/Linting
|
||||||
use { "neoclide/coc.nvim", branch = 'release', config = config("coc") }
|
use { "neoclide/coc.nvim", config = config("coc"), branch = "release" }
|
||||||
use { "glepnir/lspsaga.nvim", branch = "main", config = config("lspsaga") }
|
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
||||||
|
|
|
@ -109,12 +109,6 @@ _G.packer_plugins = {
|
||||||
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
|
||||||
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
|
||||||
},
|
},
|
||||||
["lspsaga.nvim"] = {
|
|
||||||
config = { 'require "config.lspsaga"' },
|
|
||||||
loaded = true,
|
|
||||||
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/lspsaga.nvim",
|
|
||||||
url = "https://github.com/glepnir/lspsaga.nvim"
|
|
||||||
},
|
|
||||||
["lualine.nvim"] = {
|
["lualine.nvim"] = {
|
||||||
config = { 'require "config.lualine"' },
|
config = { 'require "config.lualine"' },
|
||||||
loaded = true,
|
loaded = true,
|
||||||
|
@ -122,6 +116,7 @@ _G.packer_plugins = {
|
||||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||||
},
|
},
|
||||||
["novim-mode"] = {
|
["novim-mode"] = {
|
||||||
|
config = { 'require "config.novim"' },
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/novim-mode",
|
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/novim-mode",
|
||||||
url = "https://github.com/tombh/novim-mode"
|
url = "https://github.com/tombh/novim-mode"
|
||||||
|
@ -187,46 +182,46 @@ _G.packer_plugins = {
|
||||||
}
|
}
|
||||||
|
|
||||||
time([[Defining packer_plugins]], false)
|
time([[Defining packer_plugins]], false)
|
||||||
-- Config for: indent-blankline.nvim
|
|
||||||
time([[Config for indent-blankline.nvim]], true)
|
|
||||||
require "config.indent-blankline"
|
|
||||||
time([[Config for indent-blankline.nvim]], false)
|
|
||||||
-- Config for: Comment.nvim
|
|
||||||
time([[Config for Comment.nvim]], true)
|
|
||||||
require "config.comment"
|
|
||||||
time([[Config for Comment.nvim]], false)
|
|
||||||
-- Config for: nvim-treesitter
|
|
||||||
time([[Config for nvim-treesitter]], true)
|
|
||||||
require "config.treesitter"
|
|
||||||
time([[Config for nvim-treesitter]], false)
|
|
||||||
-- Config for: lspsaga.nvim
|
|
||||||
time([[Config for lspsaga.nvim]], true)
|
|
||||||
require "config.lspsaga"
|
|
||||||
time([[Config for lspsaga.nvim]], false)
|
|
||||||
-- Config for: barbar.nvim
|
|
||||||
time([[Config for barbar.nvim]], true)
|
|
||||||
require "config.barbar"
|
|
||||||
time([[Config for barbar.nvim]], false)
|
|
||||||
-- Config for: lualine.nvim
|
|
||||||
time([[Config for lualine.nvim]], true)
|
|
||||||
require "config.lualine"
|
|
||||||
time([[Config for lualine.nvim]], false)
|
|
||||||
-- Config for: coc.nvim
|
-- Config for: coc.nvim
|
||||||
time([[Config for coc.nvim]], true)
|
time([[Config for coc.nvim]], true)
|
||||||
require "config.coc"
|
require "config.coc"
|
||||||
time([[Config for coc.nvim]], false)
|
time([[Config for coc.nvim]], false)
|
||||||
-- Config for: dashboard-nvim
|
-- Config for: barbar.nvim
|
||||||
time([[Config for dashboard-nvim]], true)
|
time([[Config for barbar.nvim]], true)
|
||||||
require "config.dashboard"
|
require "config.barbar"
|
||||||
time([[Config for dashboard-nvim]], false)
|
time([[Config for barbar.nvim]], false)
|
||||||
-- Config for: toggleterm.nvim
|
|
||||||
time([[Config for toggleterm.nvim]], true)
|
|
||||||
require "config.toggleterm"
|
|
||||||
time([[Config for toggleterm.nvim]], false)
|
|
||||||
-- Config for: nvim-tree.lua
|
-- Config for: nvim-tree.lua
|
||||||
time([[Config for nvim-tree.lua]], true)
|
time([[Config for nvim-tree.lua]], true)
|
||||||
require "config.nvim-tree"
|
require "config.nvim-tree"
|
||||||
time([[Config for nvim-tree.lua]], false)
|
time([[Config for nvim-tree.lua]], false)
|
||||||
|
-- Config for: dashboard-nvim
|
||||||
|
time([[Config for dashboard-nvim]], true)
|
||||||
|
require "config.dashboard"
|
||||||
|
time([[Config for dashboard-nvim]], false)
|
||||||
|
-- Config for: nvim-treesitter
|
||||||
|
time([[Config for nvim-treesitter]], true)
|
||||||
|
require "config.treesitter"
|
||||||
|
time([[Config for nvim-treesitter]], false)
|
||||||
|
-- Config for: lualine.nvim
|
||||||
|
time([[Config for lualine.nvim]], true)
|
||||||
|
require "config.lualine"
|
||||||
|
time([[Config for lualine.nvim]], false)
|
||||||
|
-- Config for: indent-blankline.nvim
|
||||||
|
time([[Config for indent-blankline.nvim]], true)
|
||||||
|
require "config.indent-blankline"
|
||||||
|
time([[Config for indent-blankline.nvim]], false)
|
||||||
|
-- Config for: novim-mode
|
||||||
|
time([[Config for novim-mode]], true)
|
||||||
|
require "config.novim"
|
||||||
|
time([[Config for novim-mode]], false)
|
||||||
|
-- Config for: toggleterm.nvim
|
||||||
|
time([[Config for toggleterm.nvim]], true)
|
||||||
|
require "config.toggleterm"
|
||||||
|
time([[Config for toggleterm.nvim]], false)
|
||||||
|
-- Config for: Comment.nvim
|
||||||
|
time([[Config for Comment.nvim]], true)
|
||||||
|
require "config.comment"
|
||||||
|
time([[Config for Comment.nvim]], false)
|
||||||
|
|
||||||
_G._packer.inside_compile = false
|
_G._packer.inside_compile = false
|
||||||
if _G._packer.needs_bufread == true then
|
if _G._packer.needs_bufread == true then
|
||||||
|
|
Reference in a new issue