add autocommands

add autocommands

fix

fix

s

fix close
pull/39/head
christianchiarulli 2 years ago committed by ChristianChiarulli
parent a7e69ddee3
commit 6e30af8ab7

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

@ -0,0 +1,33 @@
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 = {
guifg = { attribute = "fg", highlight = "TabLineSel" },
guibg = { attribute = "bg", highlight = "TabLineSel" },
guifg = { attribute = "fg", highlight = "TabLine" },
guibg = { attribute = "bg", highlight = "TabLine" },
},
close_button_visible = {
guifg = { attribute = "fg", highlight = "TabLineSel" },
guibg = { attribute = "bg", highlight = "TabLineSel" },
guifg = { attribute = "fg", highlight = "TabLine" },
guibg = { attribute = "bg", highlight = "TabLine" },
},
-- close_button_selected = {
-- guifg = {attribute='fg',highlight='TabLineSel'},

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

@ -87,8 +87,7 @@ local mappings = {
["e"] = { "<cmd>NvimTreeToggle<cr>", "Explorer" },
["w"] = { "<cmd>w!<CR>", "Save" },
["q"] = { "<cmd>q!<CR>", "Quit" },
["/"] = { "<cmd>lua require('Comment').toggle()<CR>", "Comment" },
["c"] = { "<cmd>Bdelete! %d<CR>", "Close Buffer" },
["c"] = { "<cmd>Bdelete!<CR>", "Close Buffer" },
["h"] = { "<cmd>nohlsearch<CR>", "No Highlight" },
["f"] = {
"<cmd>lua require('telescope.builtin').find_files(require('telescope.themes').get_dropdown{previewer = false})<cr>",
@ -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.register(mappings, opts)
which_key.register(vmappings, vopts)

Loading…
Cancel
Save