Compare commits

...

8 Commits

Author SHA1 Message Date
Christian Chiarulli 24e1856862
Merge pull request #152 from rohanghige/22-autocommands
3 years ago
Rohan Ghige 219abb0e68 [FIX] Tree-sitter ensure_installed comment
3 years ago
Rohan Ghige 0dbe9df716 Fix warning in jsonls and whichkey
3 years ago
Rohan Ghige 6755f98df9 [FIX] nvim-tree warnings
3 years ago
Rohan Ghige 23c927e16d [FIX] cmp documentation error
3 years ago
Rohan Ghige a7e69fca89 [FIX] Tree-sitter ensure_installed error message
3 years ago
christianchiarulli 83357089dd note for autocommands
3 years ago
christianchiarulli 6e30af8ab7 add autocommands
3 years ago

@ -18,3 +18,4 @@ require "user.impatient"
require "user.indentline" require "user.indentline"
require "user.alpha" require "user.alpha"
require "user.whichkey" require "user.whichkey"
require "user.autocommands"

@ -0,0 +1,34 @@
-- autocmd! remove all autocommands, if entered under a group it will clear that group
vim.cmd [[
augroup _general_settings
autocmd!
autocmd FileType qf,help,man,lspinfo nnoremap <silent> <buffer> q :close<CR>
autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Search', timeout = 200})
autocmd BufWinEnter * :set formatoptions-=cro
autocmd FileType qf set nobuflisted
augroup end
augroup _git
autocmd!
autocmd FileType gitcommit setlocal wrap
autocmd FileType gitcommit setlocal spell
augroup end
augroup _markdown
autocmd!
autocmd FileType markdown setlocal wrap
autocmd FileType markdown setlocal spell
augroup end
augroup _auto_resize
autocmd!
autocmd VimResized * tabdo wincmd =
augroup end
augroup _alpha
autocmd!
autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
augroup end
]]

@ -92,12 +92,12 @@ bufferline.setup {
}, },
close_button = { close_button = {
guifg = { attribute = "fg", highlight = "TabLineSel" }, guifg = { attribute = "fg", highlight = "TabLine" },
guibg = { attribute = "bg", highlight = "TabLineSel" }, guibg = { attribute = "bg", highlight = "TabLine" },
}, },
close_button_visible = { close_button_visible = {
guifg = { attribute = "fg", highlight = "TabLineSel" }, guifg = { attribute = "fg", highlight = "TabLine" },
guibg = { attribute = "bg", highlight = "TabLineSel" }, guibg = { attribute = "bg", highlight = "TabLine" },
}, },
-- close_button_selected = { -- close_button_selected = {
-- guifg = {attribute='fg',highlight='TabLineSel'}, -- guifg = {attribute='fg',highlight='TabLineSel'},

@ -119,9 +119,11 @@ cmp.setup {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = false, select = false,
}, },
window = {
documentation = { documentation = {
border = { "", "", "", "", "", "", "", "" }, border = { "", "", "", "", "", "", "", "" },
}, },
},
experimental = { experimental = {
ghost_text = false, ghost_text = false,
native_menu = false, native_menu = false,

@ -169,6 +169,9 @@ local schemas = {
} }
local function extend(tab1, tab2) local function extend(tab1, tab2)
if tab2 == nil then
return tab2
end
for _, value in ipairs(tab2) do for _, value in ipairs(tab2) do
table.insert(tab1, value) table.insert(tab1, value)
end end

@ -68,7 +68,7 @@ lualine.setup({
theme = "auto", theme = "auto",
component_separators = { left = "", right = "" }, component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },
disabled_filetypes = { "dashboard", "NvimTree", "Outline" }, disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline" },
always_divide_middle = true, always_divide_middle = true,
}, },
sections = { sections = {

@ -42,7 +42,6 @@ nvim_tree.setup {
"dashboard", "dashboard",
"alpha", "alpha",
}, },
auto_close = true,
open_on_tab = false, open_on_tab = false,
hijack_cursor = false, hijack_cursor = false,
update_cwd = true, update_cwd = true,
@ -98,15 +97,12 @@ nvim_tree.setup {
cmd = "trash", cmd = "trash",
require_confirm = true, require_confirm = true,
}, },
quit_on_open = 0, actions = {
git_hl = 1, open_file = {
disable_window_picker = 0, quit_on_open = false,
root_folder_modifier = ":t", window_picker = {
show_icons = { enable = false,
git = 1, },
folders = 1, },
files = 1,
folder_arrows = 1,
tree_width = 30,
}, },
} }

@ -4,7 +4,7 @@ if not status_ok then
end end
configs.setup { configs.setup {
ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages ensure_installed = "all", -- "all" (parsers with maintainers), or a list of languages
sync_install = false, -- install languages synchronously (only applied to `ensure_installed`) sync_install = false, -- install languages synchronously (only applied to `ensure_installed`)
ignore_install = { "" }, -- List of parsers to ignore installing ignore_install = { "" }, -- List of parsers to ignore installing
autopairs = { autopairs = {

@ -87,8 +87,7 @@ local mappings = {
["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" }, ["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
["w"] = { "<cmd>w!<CR>", "Save" }, ["w"] = { "<cmd>w!<CR>", "Save" },
["q"] = { "<cmd>q!<CR>", "Quit" }, ["q"] = { "<cmd>q!<CR>", "Quit" },
["/"] = { "<cmd>lua require('Comment').toggle()<CR>", "Comment" }, ["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" },
["c"] = { "<cmd>Bdelete! %d<CR>", "Close Buffer" },
["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" }, ["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
["f"] = { ["f"] = {
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>", "<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>",
@ -144,7 +143,7 @@ local mappings = {
i = { "<cmd>LspInfo<cr>", "Info" }, i = { "<cmd>LspInfo<cr>", "Info" },
I = { "<cmd>LspInstallInfo<cr>", "Installer Info" }, I = { "<cmd>LspInstallInfo<cr>", "Installer Info" },
j = { j = {
"<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", "<cmd>lua vim.diagnostic.goto_next()<CR>",
"Next Diagnostic", "Next Diagnostic",
}, },
k = { k = {
@ -152,7 +151,7 @@ local mappings = {
"Prev Diagnostic", "Prev Diagnostic",
}, },
l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" }, l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Quickfix" }, q = { "<cmd>lua vim.diagnostic.setloclist()<cr>", "Quickfix" },
r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" }, r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" }, s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
S = { S = {
@ -184,18 +183,5 @@ local mappings = {
}, },
} }
local vopts = {
mode = "v", -- VISUAL mode
prefix = "<leader>",
buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
silent = true, -- use `silent` when creating keymaps
noremap = true, -- use `noremap` when creating keymaps
nowait = true, -- use `nowait` when creating keymaps
}
local vmappings = {
["/"] = { "<ESC><CMD>lua require('Comment.api').gc(vim.fn.visualmode())<CR>", "Comment" },
}
which_key.setup(setup) which_key.setup(setup)
which_key.register(mappings, opts) which_key.register(mappings, opts)
which_key.register(vmappings, vopts)

Loading…
Cancel
Save