mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
NVIM
- VIM options updated for: autowrite, formatoptions, conceallevel, sidescrolloff, updatetime, wildmode - LSP_config: options to display diagnostic icons, inlay hints - Lint: codespell on "*" removed it wasn't working - Formatting: ignore errors - LuaSnip: Tab fix reversed, interfered with regular operations - NVIM: Options for splitkeep & markdown_recommended_style
This commit is contained in:
@@ -14,3 +14,6 @@ vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"
|
|||||||
vim.opt.wrap = true
|
vim.opt.wrap = true
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
vim.opt.inccommand = "split" -- With :%s command, show the preview in a split instead of inline
|
vim.opt.inccommand = "split" -- With :%s command, show the preview in a split instead of inline
|
||||||
|
vim.opt.splitkeep = "screen"
|
||||||
|
-- Fix markdown indentation settings
|
||||||
|
vim.g.markdown_recommended_style = 0
|
||||||
|
|||||||
@@ -74,16 +74,15 @@ return {
|
|||||||
{
|
{
|
||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
keys = {
|
keys = {
|
||||||
-- TODO: Verify if this fixed the tab-going-crazy-sometimes issue
|
{
|
||||||
-- {
|
"<tab>",
|
||||||
-- "<tab>",
|
function()
|
||||||
-- function()
|
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||||
-- return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
end,
|
||||||
-- end,
|
expr = true,
|
||||||
-- expr = true,
|
silent = true,
|
||||||
-- silent = true,
|
mode = "i",
|
||||||
-- mode = "i",
|
},
|
||||||
-- },
|
|
||||||
{
|
{
|
||||||
"<tab>",
|
"<tab>",
|
||||||
function()
|
function()
|
||||||
|
|||||||
@@ -29,9 +29,11 @@ return {
|
|||||||
format_on_save = {
|
format_on_save = {
|
||||||
lsp_fallback = true,
|
lsp_fallback = true,
|
||||||
async = false,
|
async = false,
|
||||||
timeout_ms = 1000,
|
timeout_ms = 3000,
|
||||||
|
quiet = false,
|
||||||
},
|
},
|
||||||
formatters = {
|
formatters = {
|
||||||
|
injected = { options = { ignore_errors = true } },
|
||||||
shfmt = {
|
shfmt = {
|
||||||
prepend_args = { "-i", "4" },
|
prepend_args = { "-i", "4" },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ return {
|
|||||||
typescriptreact = { "codespell" },
|
typescriptreact = { "codespell" },
|
||||||
javascriptreact = { "codespell" },
|
javascriptreact = { "codespell" },
|
||||||
html = { "codespell" },
|
html = { "codespell" },
|
||||||
["*"] = { "codespell" },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||||
|
|||||||
@@ -36,14 +36,11 @@ return {
|
|||||||
-- Automatically install LSPs to stdpath for neovim
|
-- Automatically install LSPs to stdpath for neovim
|
||||||
{ "williamboman/mason.nvim", config = true },
|
{ "williamboman/mason.nvim", config = true },
|
||||||
{ "williamboman/mason-lspconfig.nvim" },
|
{ "williamboman/mason-lspconfig.nvim" },
|
||||||
|
{ "folke/neodev.nvim" },
|
||||||
|
|
||||||
-- Useful status updates for LSP
|
-- Useful status updates for LSP
|
||||||
{ "j-hui/fidget.nvim", opts = {} },
|
{ "j-hui/fidget.nvim", opts = {} },
|
||||||
|
|
||||||
{ "folke/neodev.nvim" },
|
|
||||||
},
|
},
|
||||||
-- WARN: DO NOT do `config` here it would override `config` from coding-formatting.lua
|
|
||||||
-- That's why we do the LSP config inside mason-lspconfig
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -68,7 +65,7 @@ return {
|
|||||||
Lua = {
|
Lua = {
|
||||||
workspace = { checkThirdParty = false },
|
workspace = { checkThirdParty = false },
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
-- hint = { enable = true },
|
completion = { callSnippet = "Replace" },
|
||||||
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
-- diagnostics = { disable = { 'missing-fields' } },
|
||||||
},
|
},
|
||||||
@@ -127,10 +124,29 @@ return {
|
|||||||
mason_lspconfig.setup_handlers({
|
mason_lspconfig.setup_handlers({
|
||||||
function(server_name)
|
function(server_name)
|
||||||
require("lspconfig")[server_name].setup({
|
require("lspconfig")[server_name].setup({
|
||||||
|
inlay_hints = { enabled = true },
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
settings = servers[server_name],
|
settings = servers[server_name],
|
||||||
filetypes = (servers[server_name] or {}).filetypes,
|
filetypes = (servers[server_name] or {}).filetypes,
|
||||||
|
diagnostics = {
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
source = "if_many",
|
||||||
|
prefix = "●",
|
||||||
|
},
|
||||||
|
severity_sort = true,
|
||||||
|
signs = {
|
||||||
|
text = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = require("config.util").icons.diagnostics.Error,
|
||||||
|
[vim.diagnostic.severity.WARN] = require("config.util").icons.diagnostics.Warn,
|
||||||
|
[vim.diagnostic.severity.HINT] = require("config.util").icons.diagnostics.Hint,
|
||||||
|
[vim.diagnostic.severity.INFO] = require("config.util").icons.diagnostics.Info,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,10 +13,12 @@ set shortmess+=I " Disable the default Vim startup message.
|
|||||||
set shortmess+=s " Less verbose search messages
|
set shortmess+=s " Less verbose search messages
|
||||||
set mouse+=a " Enable mouse support
|
set mouse+=a " Enable mouse support
|
||||||
set encoding=utf-8 " Encoding
|
set encoding=utf-8 " Encoding
|
||||||
|
set autowrite " Enable auto write
|
||||||
set autoread " Auto reload file if externally changed
|
set autoread " Auto reload file if externally changed
|
||||||
set nrformats-=octal " Do not let Ctrl-a + Ctrl-x work on octal format numbers
|
set nrformats-=octal " Do not let Ctrl-a + Ctrl-x work on octal format numbers
|
||||||
set formatoptions+=j " When joining lines with J, delete comment characters
|
set formatoptions=jcroqlnt " When joining lines with J, delete comment characters
|
||||||
set display+=truncate " @@@ is displayed in the 1st column of the last screen line
|
set display+=truncate " @@@ is displayed in the 1st column of the last screen line
|
||||||
|
set conceallevel=2 " Hide * markup for bold and italic, but not markers with substitutions
|
||||||
set tabpagemax=50 " Max number of tabs
|
set tabpagemax=50 " Max number of tabs
|
||||||
set viminfo^=!
|
set viminfo^=!
|
||||||
set viewoptions-=options
|
set viewoptions-=options
|
||||||
@@ -24,7 +26,8 @@ set nolangremap " Do not use non-English keyboards to define keymaps
|
|||||||
set list " Show tabs as >, trailing spaces as -, non-breakable space as +
|
set list " Show tabs as >, trailing spaces as -, non-breakable space as +
|
||||||
set signcolumn=yes " Always show the signs column (before line number column)
|
set signcolumn=yes " Always show the signs column (before line number column)
|
||||||
set scrolloff=10 " Cursor always at middle of the screen
|
set scrolloff=10 " Cursor always at middle of the screen
|
||||||
set updatetime=249 " No typing for this millisec -> write to swap file
|
set sidescrolloff=10
|
||||||
|
set updatetime=200 " No typing for this millisec -> write to swap file
|
||||||
set timeoutlen=500 " Multiple keys in keymaps must be pressed in these millisecs
|
set timeoutlen=500 " Multiple keys in keymaps must be pressed in these millisecs
|
||||||
set noswapfile " Turn off swapfiles
|
set noswapfile " Turn off swapfiles
|
||||||
set history=10000 " Number of : commands to save
|
set history=10000 " Number of : commands to save
|
||||||
@@ -56,6 +59,7 @@ set complete-=i
|
|||||||
set completeopt="menuone,noselect" " Better completion experience
|
set completeopt="menuone,noselect" " Better completion experience
|
||||||
set wildmenu " List and cycle through autocomplete on <Tab>
|
set wildmenu " List and cycle through autocomplete on <Tab>
|
||||||
set wildignorecase " Case insensitive path completion
|
set wildignorecase " Case insensitive path completion
|
||||||
|
set wildmode="longest:full,full" " Command-line completion mode
|
||||||
|
|
||||||
" Remove trailing blank spaces on save
|
" Remove trailing blank spaces on save
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
autocmd BufWritePre * %s/\s\+$//e
|
||||||
|
|||||||
Reference in New Issue
Block a user