even more changes

This commit is contained in:
Andy Teijelo 2022-10-12 22:04:30 -04:00
parent 081a29441f
commit 7e8a0fe352

View file

@ -32,20 +32,21 @@ require("colorschemes")
vim.cmd("hi MatchParen cterm=bold,underline gui=bold,underline")
vim.api.nvim_set_keymap("n", "<SPACE>", "<Nop>", { noremap = true })
--vim.api.nvim_set_keymap("n", "<SPACE>", "<Nop>", { noremap = true })
vim.g.mapleader = " "
vim.api.nvim_set_keymap("n", "<Leader>bc", "<Cmd>BufferLinePickClose<CR>", { noremap = true, silent = true })
--local harpoon_ui = require("harpoon.ui")
--local harpoon_mark = require("harpoon.mark")
--vim.keymap.set("n", '<A-,>', harpoon_ui.toggle_quick_menu)
--for _, mode in ipairs({"n", "i", "v"}) do
-- vim.keymap.set(mode, '<A-b>', harpoon_mark.add_file)
-- vim.keymap.set(mode, '<A-1>', function() harpoon_ui.nav_file(1) end, { noremap = true })
-- vim.keymap.set(mode, '<A-2>', function() harpoon_ui.nav_file(2) end, { noremap = true })
-- vim.keymap.set(mode, '<A-3>', function() harpoon_ui.nav_file(3) end, { noremap = true })
-- vim.keymap.set(mode, '<A-4>', function() harpoon_ui.nav_file(4) end, { noremap = true })
-- vim.keymap.set(mode, '<A-5>', function() harpoon_ui.nav_file(5) end, { noremap = true })
--end
for _, mode in ipairs({"n", "i", "v"}) do
vim.keymap.set(mode, '<A-1>', "<Cmd>BufferLineGoToBuffer 1<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, '<A-2>', "<Cmd>BufferLineGoToBuffer 2<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, '<A-3>', "<Cmd>BufferLineGoToBuffer 3<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, '<A-4>', "<Cmd>BufferLineGoToBuffer 4<CR>", { noremap = true, silent = true })
vim.keymap.set(mode, '<A-5>', "<Cmd>BufferLineGoToBuffer 5<CR>", { noremap = true, silent = true })
end
for _, mode in ipairs({"n", "v"}) do
vim.api.nvim_set_keymap(mode, "<Up>", "g<Up>", { noremap = true })
@ -59,9 +60,9 @@ end
vim.api.nvim_set_keymap('v', "<M-j>", ":MoveBlock(1)<CR>", { noremap = true })
vim.api.nvim_set_keymap('v', "<M-k>", ":MoveBlock(-1)<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<Leader>o", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<Leader>lj", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
--vim.api.nvim_set_keymap("n", "<M-o>", "<Cmd>lua vim.diagnostic.open_float()<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<Leader>i", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
vim.api.nvim_set_keymap("n", "<Leader>la", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true, silent = true })
--vim.api.nvim_set_keymap("n", "<M-i>", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { noremap = true })
require('telescope').setup({
@ -134,10 +135,17 @@ require('treesitter')
require('nvim_comment').setup()
--vim.keymap.set('v', '<A-->', "<Cmd>'<,'>CommentToggle<CR>")
vim.keymap.set('v', 'C-/', "<Cmd>'<,'>CommentToggle<CR>")
vim.keymap.set('n', 'C-/', "<Cmd>CommentToggle<CR>")
vim.keymap.set('v', '<C-/>', "<Cmd>'<,'>CommentToggle<CR>")
vim.keymap.set('n', '<C-/>', "<Cmd>CommentToggle<CR>")
--vim.keymap.set('n', '<A-->', "<Cmd>CommentToggle<CR>")
-- hover on K
vim.keymap.set('n', 'K', vim.lsp.buf.hover)
-- Change border of documentation hover window, See https://github.com/neovim/neovim/pull/13998.
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
-- format on save
--vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
@ -148,7 +156,7 @@ require('bufferline').setup()
vim.cmd [[
fu! SaveSession()
if filereadable(getcwd() . '/Cargo.toml')
if filereadable(getcwd() . '/.session.vim')
execute 'mksession! ' . getcwd() . '/.session.vim'
endif
endfunction
@ -160,6 +168,6 @@ fu! RestoreSession()
endfunction
autocmd VimLeavePre * call SaveSession()
autocmd VimEnter * nested call RestoreSession()
"autocmd VimEnter * nested call RestoreSession()
]]