Update for nvim v0.10

This commit is contained in:
Alexander Navarro 2024-06-11 08:29:31 -04:00
parent 7dadc3afd5
commit 6b2e261d8c
7 changed files with 147 additions and 94 deletions

View file

@ -61,3 +61,5 @@ vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", default("Move selection up"))
vim.keymap.set("n", "<Leader>uI", fixIndentation, default("Fix indentation"))
vim.keymap.set("n", "<Leader>uh", ":nohl<CR>", default("Remove search highlight"))
vim.keymap.set('t', '<ESC>', '<C-\\><C-n>', default("Exit insert mode on terminal"))

View file

@ -8,47 +8,47 @@ vim.g.maplocalleader = " "
local opt = vim.opt
-- stylua: ignore
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 2 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.conceallevel = 2 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 15 -- Lines of context
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 15 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true })
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest,list:full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
@ -71,5 +71,6 @@ vim.filetype.add({
-- INFO: Match filenames like - ".env.example", ".env.local" and so on
["%.env%.[%w_.-]+"] = "dotenv",
[".*%.blade%.php"] = "blade",
[".*%.hurl.*"] = "hurl",
},
})

View file

@ -0,0 +1,38 @@
return {
"jellydn/hurl.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter"
},
ft = "hurl",
opts = {
-- Show debugging info
debug = false,
-- Show notification on run
show_notification = false,
-- Show response in popup or split
mode = "popup",
-- Default formatter
formatters = {
json = { 'jq' }, -- Make sure you have install jq in your system, e.g: brew install jq
html = {
'prettierd', -- Make sure you have install prettier in your system, e.g: npm install -g prettier
'--parser',
'html',
},
},
env_file = {
'hurl.env',
'.env',
'.env.local',
},
},
keys = {
-- Run API request
{ "<leader>ph", "<cmd>HurlRunnerAt<CR>", desc = "Run HTTP request" },
{ "<leader>pH", "<cmd>HurlRunner<CR>", desc = "Run all HTTP requests" },
-- Run Hurl request in visual mode
{ "<leader>ph", ":HurlRunner<CR>", desc = "Run HTTP requests", mode = "v" },
},
}

View file

@ -93,7 +93,13 @@ return {
},
sqlls = {},
yamlls = {},
tsserver = {},
tsserver = {
init_options = {
preferences = {
disableSuggestions = true
}
}
},
lua_ls = {
settings = {
Lua = {

View file

@ -83,9 +83,12 @@ return {
},
},
autotag = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
})
require('ts_context_commentstring').setup {
enable_autocmd = false,
}
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"