summaryrefslogtreecommitdiffstats
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--.config/nvim/after/plugin/floaterm.lua9
-rw-r--r--.config/nvim/after/plugin/startify.lua29
-rw-r--r--.config/nvim/after/plugin/toggleterm.lua29
-rw-r--r--.config/nvim/after/plugin/whichkey.lua79
-rw-r--r--.config/nvim/lua/bindings.lua40
-rw-r--r--.config/nvim/lua/pack.lua19
-rw-r--r--.config/nvim/lua/settings.lua2
7 files changed, 44 insertions, 163 deletions
diff --git a/.config/nvim/after/plugin/floaterm.lua b/.config/nvim/after/plugin/floaterm.lua
deleted file mode 100644
index f6defbe..0000000
--- a/.config/nvim/after/plugin/floaterm.lua
+++ /dev/null
@@ -1,9 +0,0 @@
--- vim.g.floaterm_autoinsert = 1
--- vim.g.floaterm_width = 0.8
--- vim.g.floaterm_height = 0.37
--- vim.g.floaterm_wintitle = 0
--- vim.g.floaterm_autoclose = 1
--- vim.g.floaterm_position = 'bottom'
--- vim.g.floaterm_gitcommit = 'split'
--- vim.g.floaterm_wintype = 'split'
--- vim.g.floaterm_rootmarkers = { '.project', '.git', '.hg', '.svn', '.root', '.gitignore', '.fslckout', '.fossil-settings' }
diff --git a/.config/nvim/after/plugin/startify.lua b/.config/nvim/after/plugin/startify.lua
deleted file mode 100644
index 61e9466..0000000
--- a/.config/nvim/after/plugin/startify.lua
+++ /dev/null
@@ -1,29 +0,0 @@
--- Startify
--- vim.cmd [[
--- let g:startify_custom_header = startify#pad([
--- \ '========================',
--- \ '===== ===============',
--- \ '====== ================',
--- \ '====== ================',
--- \ '====== ==== ==== ==',
--- \ '====== === == = =',
--- \ '====== === = == =',
--- \ '= === === = == ====',
--- \ '= === === = == = =',
--- \ '== ===== ==== ==',
--- \ '========================',
--- \ ])
--- let g:startify_lists = [
--- \ { 'type': 'sessions', 'header': startify#pad(['Sessions']) },
--- \ { 'type': 'files', 'header': startify#pad(['Recent']) },
--- \ { 'type': 'bookmarks', 'header': startify#pad(['Bookmarks']) },
--- \ { 'type': 'commands', 'header': startify#pad(['Commands']) },
--- \ ]
--- ]]
--- vim.g.startify_bookmarks = {
--- { env = '~/.config/env' },
--- { v = '~/.config/nvim/init.vim' },
--- { zc = '~/.config/zsh/.zshrc' },
--- { za = '~/.config/zsh/alias.zsh' },
--- { gj = '~/dev/go/gojosh' },
--- }
diff --git a/.config/nvim/after/plugin/toggleterm.lua b/.config/nvim/after/plugin/toggleterm.lua
deleted file mode 100644
index 766de24..0000000
--- a/.config/nvim/after/plugin/toggleterm.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-require("toggleterm").setup({
- size = 22,
- open_mapping = [[<f1>]],
- hide_numbers = true,
- shade_filetypes = {},
- shade_terminals = true,
- shading_factor = 2,
- start_in_insert = true,
- insert_mappings = true,
- persist_size = true,
- direction = "horizontal",
- close_on_exit = true,
- shell = vim.o.shell,
- float_opts = {
- border = "curved",
- winblend = 0,
- highlights = {
- border = "Normal",
- background = "Normal",
- },
- },
-})
-
-function _G.set_terminal_keymaps()
- local opts = {noremap = true}
- vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
-end
-
-vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
diff --git a/.config/nvim/after/plugin/whichkey.lua b/.config/nvim/after/plugin/whichkey.lua
deleted file mode 100644
index 003c88c..0000000
--- a/.config/nvim/after/plugin/whichkey.lua
+++ /dev/null
@@ -1,79 +0,0 @@
-local harpoon = require('harpoon')
-harpoon:setup()
-
-vim.keymap.set('n', '<M-1>', function() harpoon:list():select(1) end)
-vim.keymap.set('n', '<M-2>', function() harpoon:list():select(2) end)
-vim.keymap.set('n', '<M-3>', function() harpoon:list():select(3) end)
-vim.keymap.set('n', '<M-4>', function() harpoon:list():select(4) end)
-
-local ts = require('telescope.builtin')
-require('telescope').load_extension('harpoon')
-local wk = require('which-key')
-wk.register({
- -- harpoon
- a = {
- name = 'harpoon',
- a = { function() harpoon:list():append() end, 'add file', noremap = true, silent = true },
- e = { function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, 'harpoon ui', noremap = true, silent = true },
- f = { ':Telescope harpoon marks<CR>', 'harpoon telescope ui', noremap = true, silent = true },
- },
- d = { ':bd<CR>', 'close buffer', noremap = true, silent = true },
- D = { '"-ddk:put = strftime(\' * %a %b %d %T %Y\')<CR>', 'insert date', noremap = true, silent = true },
- h = { ':Startify<CR>', 'startify', noremap = true, silent = true },
- k = { ':w<CR>:bp<CR>:bd #<CR>', 'write and close buffer', noremap = true, silent = false },
- u = { vim.cmd.UndotreeToggle, 'undotree', noremap = true, silent = true },
- w = { ':w<CR>', 'write buffer', noremap = true, silent = false },
- -- trouble
- x = {
- name = 'trouble',
- x = { vim.cmd.TroubleToggle, 'toggle', noremap = true, silent = true },
- w = { ':TroubleToggle workspace_diagnostics<CR>', 'workspace', noremap = true, silent = true },
- d = { ':TroubleToggle document_diagnostics<CR>', 'document', noremap = true, silent = true },
- l = { ':TroubleToggle loclist<CR>', 'local list', noremap = true, silent = true },
- q = { ':TroubleToggle quickfix<CR>', 'quickfix', noremap = true, silent = true },
- r = { ':TroubleToggle lsp_references<CR>', 'lsp', noremap = true, silent = true },
- },
- -- telescope
- f = {
- name = 'telescope',
- b = { ts.buffers, 'buffers', noremap = true, silent = true },
- d = { ts.diagnostics, 'diagnostics', noremap = true, silent = true },
- e = { ':Telescope harpoon marks<CR>', 'harpoon marks', noremap = true, silent = true },
- f = { ts.find_files, 'find files', noremap = true, silent = true },
- g = { ts.git_files, 'git files', noremap = true, silent = true },
- s = { function()
- ts.grep_string({ search = vim.fn.input("Grep > ") })
- end, 'grep string', noremap = true, silent = true },
- t = { ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST<CR>', 'todo', noremap = true, silent = true }
- },
- -- git
- g = {
- name = 'git',
- g = { vim.cmd.Git, 'git' },
- l = { ':FloatermNew lazygit<CR>', 'lazygit', noremap = true, silent = true },
- -- a = { ':Ag<CR>', 'the_silver_searcher', noremap = true, silent = true },
- -- g = { ':Grep<CR>', 'grep', noremap = true, silent = true },
- -- r = { ':Rg<CR>', 'ripgrep', noremap = true, silent = true },
- },
- -- neovim
- v = {
- name = 'nvim',
- v = { vim.cmd.Ex, 'explorer', noremap = true, silent = true },
- u = { vim.cmd.PackerSync, 'upgrade', noremap = true, silent = true },
- },
-}, { prefix = '<leader>', })
-wk.setup({
- plugins = {
- presets = {
- operators = false,
- motions = false,
- text_objects = false,
- window = false,
- nav = false,
- z = false,
- g = false
- },
- },
- triggers = { "<leader>" },
- triggers_nowait = { "d" },
-})
diff --git a/.config/nvim/lua/bindings.lua b/.config/nvim/lua/bindings.lua
index 2722301..a8cf4b3 100644
--- a/.config/nvim/lua/bindings.lua
+++ b/.config/nvim/lua/bindings.lua
@@ -26,3 +26,43 @@ vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
vim.keymap.set('x', '<leader>p', "\"_dP")
vim.keymap.set('n', 'Q', '<nop>')
+
+
+vim.keymap.set('n', '<M-1>', function() harpoon:list():select(1) end)
+vim.keymap.set('n', '<M-2>', function() harpoon:list():select(2) end)
+vim.keymap.set('n', '<M-3>', function() harpoon:list():select(3) end)
+vim.keymap.set('n', '<M-4>', function() harpoon:list():select(4) end)
+
+local ts = require('telescope.builtin')
+require('telescope').load_extension('harpoon')
+local harpoon = require('harpoon')
+harpoon:setup()
+
+-- normal
+vim.keymap.set('n', '<leader>d', ':bd<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>D', '"-ddk:put = strftime(\' * %a %b %d %T %Y\')<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>k', ':w<CR>:bp<CR>:bd #<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>u', ':w<CR>', { noremap = true, silent = true })
+-- harpoon
+vim.keymap.set('n', '<leader>aa', function() harpoon:list():append() end, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>ae', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>af', ':Telescope harpoon marks<CR>', { noremap = true, silent = true })
+-- trouble
+vim.keymap.set('n', '<leader>xx', vim.cmd.TroubleToggle, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>xx', ':TroubleToggle workspace_diagnostics<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>xd', ':TroubleToggle document_diagnostics<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>xl', ':TroubleToggle loclist<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>xq', ':TroubleToggle quickfix<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>xs', ':TroubleToggle lsp_references<CR>', { noremap = true, silent = true })
+-- telescope
+vim.keymap.set('n', '<leader>fb', ts.buffers, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>fd', ts.diagnostics, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>fe', ':Telescope harpoon marks<CR>', { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>ff', ts.find_files, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>fg', ts.git_files, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>fs', function() ts.grep_string({ search = vim.fn.input("Grep > ") }) end, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>ft', ':TodoTelescope keywords=TODO,HACK,WARN,PERF,NOTE,TEST<CR>', { noremap = true, silent = true })
+-- neovim
+vim.keymap.set('n', '<leader>vu', vim.cmd.PackerSync, { noremap = true, silent = true })
+vim.keymap.set('n', '<leader>vv', vim.cmd.Ex, { noremap = true, silent = true })
diff --git a/.config/nvim/lua/pack.lua b/.config/nvim/lua/pack.lua
index 63e8707..56745e0 100644
--- a/.config/nvim/lua/pack.lua
+++ b/.config/nvim/lua/pack.lua
@@ -13,23 +13,10 @@ return require('packer').startup({function(use)
config = function() require('nvim-autopairs').setup {} end
}
use 'jiangmiao/auto-pairs'
- use 'folke/which-key.nvim'
+ -- use 'folke/which-key.nvim'
use 'lewis6991/gitsigns.nvim'
-- use 'mhinz/vim-startify'
- use {
- 'nvimdev/dashboard-nvim',
- event = 'VimEnter',
- config = function()
- require('dashboard').setup {
- theme = 'hyper',
- hide = {
- statusLine = false,
- },
- }
- end,
- requires = {'nvim-tree/nvim-web-devicons'}
- }
- use 'mg979/vim-visual-multi'
+ -- use 'mg979/vim-visual-multi'
use 'preservim/tagbar'
-- use 'preservim/nerdcommenter'
use {
@@ -67,7 +54,7 @@ return require('packer').startup({function(use)
-- use 'tpope/vim-surround'
use 'nvim-lualine/lualine.nvim'
-- use 'voldikss/vim-floaterm'
- use 'akinsho/toggleterm.nvim'
+ -- use 'akinsho/toggleterm.nvim'
use 'chrisbra/csv.vim'
use {
'ThePrimeagen/harpoon',
diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua
index 7081b9c..91f4906 100644
--- a/.config/nvim/lua/settings.lua
+++ b/.config/nvim/lua/settings.lua
@@ -27,7 +27,7 @@ vim.opt.ruler = true
vim.opt.tabstop = 4
vim.opt.textwidth = 0
vim.opt.timeoutlen = 0
-vim.opt.timeoutlen = 250
+vim.opt.timeoutlen = 500
vim.opt.undodir = '/tmp/nvim_undo'
vim.opt.undofile = true
vim.opt.wildmode = 'longest,list,full'