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,
|
||||
"coc.preferences.formatOnSaveFiletypes": ["*"],
|
||||
"Lua.telemetry.enable": false,
|
||||
"sumneko-lua.enableNvimLuaDev": true,
|
||||
"coc.preferences.diagnostic.virtualText": true
|
||||
"diagnostic.virtualText": true
|
||||
}
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
local keymap = vim.api.nvim_set_keymap
|
||||
local expr_opts = { noremap = true, silent = true, expr = true}
|
||||
local keymap = vim.keymap.set
|
||||
local expr_opts = { replace_keycodes = false, expr = true }
|
||||
|
||||
vim.diagnostic.config { virtual_text = true }
|
||||
|
||||
keymap(
|
||||
"i",
|
||||
"<Enter>",
|
||||
[[ coc#pum#visible() ? coc#_select_confirm() : "\<Enter>" ]],
|
||||
expr_opts
|
||||
"i",
|
||||
"<Enter>",
|
||||
[[ coc#pum#visible() ? coc#_select_confirm() : "\<Enter>" ]],
|
||||
expr_opts
|
||||
)
|
||||
|
||||
keymap(
|
||||
|
|
|
@ -3,7 +3,7 @@ local db = require('dashboard')
|
|||
db.hide_tabline = false
|
||||
db.custom_center = {
|
||||
{ icon = ' ',
|
||||
desc = 'Recently latest session ',
|
||||
desc = 'Latest Session ',
|
||||
shortcut = '',
|
||||
action = 'OpenSession' },
|
||||
{ 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.api.nvim_set_keymap
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
|
@ -13,4 +12,4 @@ nvimtree.setup({
|
|||
})
|
||||
|
||||
-- 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")
|
||||
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_autosave = 'yes'
|
||||
vim.g.sudo_smart_edit = 1
|
||||
|
|
|
@ -6,7 +6,7 @@ end
|
|||
|
||||
return packer.startup({ function(use)
|
||||
-- Utility
|
||||
use 'tombh/novim-mode'
|
||||
use { 'tombh/novim-mode', config = config("novim") }
|
||||
use { 'akinsho/toggleterm.nvim', config = config("toggleterm") }
|
||||
use 'tpope/vim-sleuth'
|
||||
use {
|
||||
|
@ -34,8 +34,7 @@ return packer.startup({ function(use)
|
|||
use 'kyazdani42/nvim-web-devicons'
|
||||
|
||||
-- Completion/Linting
|
||||
use { "neoclide/coc.nvim", branch = 'release', config = config("coc") }
|
||||
use { "glepnir/lspsaga.nvim", branch = "main", config = config("lspsaga") }
|
||||
use { "neoclide/coc.nvim", config = config("coc"), branch = "release" }
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
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",
|
||||
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"] = {
|
||||
config = { 'require "config.lualine"' },
|
||||
loaded = true,
|
||||
|
@ -122,6 +116,7 @@ _G.packer_plugins = {
|
|||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["novim-mode"] = {
|
||||
config = { 'require "config.novim"' },
|
||||
loaded = true,
|
||||
path = "/home/quadradical/.local/share/nvim/site/pack/packer/start/novim-mode",
|
||||
url = "https://github.com/tombh/novim-mode"
|
||||
|
@ -187,46 +182,46 @@ _G.packer_plugins = {
|
|||
}
|
||||
|
||||
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
|
||||
time([[Config for coc.nvim]], true)
|
||||
require "config.coc"
|
||||
time([[Config for coc.nvim]], false)
|
||||
-- Config for: dashboard-nvim
|
||||
time([[Config for dashboard-nvim]], true)
|
||||
require "config.dashboard"
|
||||
time([[Config for dashboard-nvim]], false)
|
||||
-- Config for: toggleterm.nvim
|
||||
time([[Config for toggleterm.nvim]], true)
|
||||
require "config.toggleterm"
|
||||
time([[Config for toggleterm.nvim]], false)
|
||||
-- Config for: barbar.nvim
|
||||
time([[Config for barbar.nvim]], true)
|
||||
require "config.barbar"
|
||||
time([[Config for barbar.nvim]], false)
|
||||
-- Config for: nvim-tree.lua
|
||||
time([[Config for nvim-tree.lua]], true)
|
||||
require "config.nvim-tree"
|
||||
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
|
||||
if _G._packer.needs_bufread == true then
|
||||
|
|
Reference in a new issue