-
-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated the whole config (except dap) for neovim 0.8 (#53)
- Loading branch information
1 parent
a3e39b0
commit f03955d
Showing
17 changed files
with
398 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,71 @@ | ||
-- Use 'q' to quit from common plugins | ||
vim.api.nvim_create_autocmd({ "FileType" }, { | ||
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel", "lir" }, | ||
callback = function() | ||
vim.cmd [[ | ||
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel" }, | ||
callback = function() | ||
vim.cmd([[ | ||
nnoremap <silent> <buffer> q :close<CR> | ||
set nobuflisted | ||
]] | ||
end, | ||
]]) | ||
end, | ||
}) | ||
|
||
-- Remove statusline and tabline when in Alpha | ||
vim.api.nvim_create_autocmd({ "User" }, { | ||
pattern = { "AlphaReady" }, | ||
callback = function() | ||
vim.cmd [[ | ||
set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2 | ||
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3 | ||
]] | ||
end, | ||
vim.api.nvim_create_autocmd({ "FileType" }, { | ||
pattern = { "gitcommit"}, | ||
callback = function() | ||
vim.opt_local.wrap = true | ||
vim.opt_local.spell = true | ||
end, | ||
}) | ||
|
||
-- Set wrap and spell in markdown and gitcommit | ||
vim.api.nvim_create_autocmd({ "FileType" }, { | ||
pattern = { "gitcommit", "markdown" }, | ||
callback = function() | ||
vim.opt_local.wrap = true | ||
vim.opt_local.spell = true | ||
end, | ||
pattern = { "markdown" }, | ||
callback = function() | ||
vim.opt_local.wrap = true | ||
vim.opt_local.spell = true | ||
end, | ||
}) | ||
|
||
vim.cmd "autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif" | ||
|
||
-- Fixes Autocomment | ||
vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif") | ||
-- vim.api.nvim_create_autocmd({ "BufEnter" }, { | ||
-- callback = function() | ||
-- vim.cmd [[ | ||
-- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif | ||
-- ]] | ||
-- end, | ||
-- }) | ||
|
||
vim.api.nvim_create_autocmd({ "VimResized" }, { | ||
callback = function() | ||
vim.cmd("tabdo wincmd =") | ||
end, | ||
}) | ||
|
||
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, { | ||
callback = function() | ||
vim.cmd("quit") | ||
end, | ||
}) | ||
vim.api.nvim_create_autocmd({ "BufWinEnter" }, { | ||
callback = function() | ||
vim.cmd "set formatoptions-=cro" | ||
end, | ||
callback = function() | ||
vim.cmd("set formatoptions-=cro") | ||
end, | ||
}) | ||
|
||
-- Highlight Yanked Text | ||
vim.api.nvim_create_autocmd({ "TextYankPost" }, { | ||
callback = function() | ||
vim.highlight.on_yank { higroup = "Visual", timeout = 200 } | ||
end, | ||
callback = function() | ||
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 }) | ||
end, | ||
}) | ||
|
||
vim.api.nvim_create_autocmd({ "BufWritePost" }, { | ||
pattern = { "*.java" }, | ||
callback = function() | ||
vim.lsp.codelens.refresh() | ||
end, | ||
}) | ||
|
||
vim.api.nvim_create_autocmd({ "VimEnter" }, { | ||
callback = function() | ||
vim.cmd("hi link illuminatedWord LspReferenceText") | ||
end, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
-- Setup nvim-cmp. | ||
local status_ok, npairs = pcall(require, "nvim-autopairs") | ||
if not status_ok then | ||
return | ||
return | ||
end | ||
|
||
npairs.setup { | ||
check_ts = true, -- treesitter integration | ||
disable_filetype = { "TelescopePrompt" }, | ||
} | ||
npairs.setup({ | ||
check_ts = true, -- treesitter integration | ||
disable_filetype = { "TelescopePrompt" }, | ||
ts_config = { | ||
lua = { "string", "source" }, | ||
javascript = { "string", "template_string" }, | ||
java = false, | ||
}, | ||
|
||
local cmp_autopairs = require "nvim-autopairs.completion.cmp" | ||
fast_wrap = { | ||
map = "<M-e>", | ||
chars = { "{", "[", "(", '"', "'" }, | ||
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), | ||
offset = 0, -- Offset from pattern match | ||
end_key = "$", | ||
keys = "qwertyuiopzxcvbnmasdfghjkl", | ||
check_comma = true, | ||
highlight = "PmenuSel", | ||
highlight_grey = "LineNr", | ||
}, | ||
}) | ||
|
||
local cmp_autopairs = require("nvim-autopairs.completion.cmp") | ||
local cmp_status_ok, cmp = pcall(require, "cmp") | ||
if not cmp_status_ok then | ||
return | ||
return | ||
end | ||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done {}) | ||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.