add old nvim bindings
This commit is contained in:
parent
29c77cd7e5
commit
f57c054aa0
|
@ -0,0 +1,148 @@
|
|||
|
||||
-- Settings
|
||||
vim.opt.relativenumber = true
|
||||
-- The backspace key has slightly unintuitive behavior by default. For example,
|
||||
-- by default, you can't backspace before the insertion point set with 'i'.
|
||||
-- This configuration makes backspace behave more reasonably, in that you can
|
||||
-- backspace over anything.
|
||||
vim.opt.backspace = { 'indent', 'eol', 'start' }
|
||||
-- By default, Vim doesn't let you hide a buffer (i.e. have a buffer that isn't
|
||||
-- shown in any window) that has unsaved changes. This is to prevent you from
|
||||
-- forgetting about unsaved changes and then quitting e.g. via `:qa!`. We find
|
||||
-- hidden buffers helpful enough to disable this protection. See `:help hidden`
|
||||
-- for more information on this.
|
||||
vim.opt.hidden = true
|
||||
-- This setting makes search case-insensitive when all characters in the string
|
||||
-- being searched are lowercase. However, the search becomes case-sensitive if
|
||||
-- it contains any capital letters. This makes searching more convenient.
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
-- Enable searching as you type, rather than waiting till you press enter.
|
||||
vim.opt.incsearch = true
|
||||
-- Unbind some useless/annoying default key bindings.
|
||||
-- 'Q' in normal mode enters Ex mode. You almost never want this.
|
||||
vim.keymap.set('n', 'Q', '<Nop>', { noremap = true, silent = true })
|
||||
-- Tab settings
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
-- Do smart autoindenting when starting a new line.
|
||||
vim.opt.smartindent = true
|
||||
vim.opt.shiftwidth = 4
|
||||
-- Always block cursor
|
||||
vim.opt.guicursor = ''
|
||||
-- Disable highlighted search matches
|
||||
vim.opt.hlsearch = false
|
||||
-- Disable swapfiles
|
||||
vim.opt.swapfile = false
|
||||
-- undo settings
|
||||
vim.opt.undodir = vim.fn.expand('$HOME') .. '/nvim/undo'
|
||||
vim.opt.undofile = true
|
||||
-- Enables 24-bit RGB color
|
||||
vim.opt.termguicolors = true
|
||||
-- Scroll settings
|
||||
vim.opt.scrolloff = 8
|
||||
-- Turn off -- INSERT -- message
|
||||
vim.opt.showmode = false
|
||||
-- Add column for hints to prevent gitter
|
||||
vim.opt.signcolumn = 'yes'
|
||||
-- Highlight current line of cursor
|
||||
vim.opt.cursorline = true
|
||||
-- Clipboard settings
|
||||
-- ALWAYS use the clipboard for ALL operations (instead of interacting with
|
||||
--the '+' and/or '*' registers explicitly)
|
||||
-- vim.opt.clipboard = 'unnamedplus'
|
||||
-- Wrappring settings
|
||||
vim.opt.wrap = false
|
||||
--global status line
|
||||
vim.opt.laststatus = 3
|
||||
|
||||
|
||||
-- Colorscheme
|
||||
-- https://github.com/projekt0n/github-nvim-theme
|
||||
require("github-theme").setup({
|
||||
specs = {
|
||||
all = {
|
||||
diag = {
|
||||
error = 'red',
|
||||
hint = 'orange',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
groups = {
|
||||
all = {
|
||||
StatusLine = {link = "Comment"},
|
||||
Search = {link = "TSNote"},
|
||||
TSField = {}
|
||||
}
|
||||
}
|
||||
})
|
||||
-- vim.cmd [[colorscheme github_dark_colorblind]]
|
||||
vim.cmd.colorscheme('github_dark_colorblind')
|
||||
|
||||
|
||||
|
||||
|
||||
-- Telescope config
|
||||
-- mostly defaults pulled from the docs
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup{
|
||||
defaults = {
|
||||
-- Default configuration for telescope goes here:
|
||||
-- config_key = value,
|
||||
sorting_strategy = "ascending",
|
||||
-- winblend = 30,
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
width = 0.95,
|
||||
height = 0.95
|
||||
}
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- map actions.which_key to <C-h> (default: <C-/>)
|
||||
-- actions.which_key shows the mappings for your picker,
|
||||
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||
["<C-y>"] = actions.select_default,
|
||||
}
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = false, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
},
|
||||
}
|
||||
-- require('telescope').load_extension('fzf')
|
||||
-- require('telescope').load_extension('dap')
|
||||
|
||||
-- Emmet
|
||||
-- C-y + ,
|
||||
vim.g.user_emmet_mode = 'n'
|
||||
vim.g.user_emmet_leader_key = ','
|
||||
vim.g.user_emmet_settings = {
|
||||
typescript = {
|
||||
extends = 'jsx',
|
||||
},
|
||||
typescriptreact = {
|
||||
extends = 'jsx',
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.neoformat_try_node_exe = 1
|
||||
|
||||
|
||||
-- -- Show diagnostic popup on cursor hover
|
||||
-- vim.g.updatetime = 300
|
||||
-- vim.cmd [[autocmd CursorHold * lua vim.diagnostic.open_float()]]
|
||||
--
|
||||
-- Rust format on save
|
||||
vim.g.rustfmt_autosave = 1
|
||||
-- Filetype detection
|
||||
vim.cmd('filetype plugin indent on')
|
|
@ -0,0 +1,95 @@
|
|||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Keymaps
|
||||
-- Paste over selection
|
||||
vim.keymap.set('v', '<leader>p', '"_dP', opts)
|
||||
-- Y copy from cursor to end of line
|
||||
vim.keymap.set('n', 'Y', 'y$', opts)
|
||||
-- Keep cursor centered when scrolling search matches
|
||||
vim.keymap.set('n', 'n', 'nzzzv', opts)
|
||||
vim.keymap.set('n', 'N', 'Nzzzv', opts)
|
||||
vim.keymap.set('n', 'J', 'mzJ`z', opts)
|
||||
-- Undo breakpoints
|
||||
vim.keymap.set('i', ',', ',<c-g>u', opts)
|
||||
vim.keymap.set('i', '.', '.<c-g>u', opts)
|
||||
vim.keymap.set('i', '!', '!<c-g>u', opts)
|
||||
vim.keymap.set('i', '?', '?<c-g>u', opts)
|
||||
-- Jumplist mutations
|
||||
vim.keymap.set('n', '<expr> k', '(v:count > 5 ? "m\'" . v:count : "") . \'k\'', opts)
|
||||
vim.keymap.set('n', '<expr> j', '(v:count > 5 ? "m\'" . v:count : "") . \'j\'', opts)
|
||||
-- Moving text
|
||||
vim.keymap.set('v', 'J', ':m \'>+1<CR>gv=gv', opts)
|
||||
vim.keymap.set('v', 'K', ':m \'>-2<CR>gv=gv', opts)
|
||||
vim.keymap.set('n', '<leader>j', ':m .+1<CR>==', opts)
|
||||
vim.keymap.set('n', '<leader>k', ':m .-2<CR>==', opts)
|
||||
|
||||
vim.keymap.set('n', '<space>ft', '<cmd>:Format<CR>', opts)
|
||||
-- GIT
|
||||
-- Fugitive git bindings
|
||||
vim.keymap.set('n', '<leader>ga', ':Git add %:p<CR><CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gs', ':Git<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gc', ':Git commit -v -q<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gt', ':Git commit -v -q %:p<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>d', ':Gdiff<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>dm', ':Gdiffsplit!<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>ge', ':Gedit<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gr', ':Gread<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gw', ':Gwrite<CR><CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gl', ':silent! Glog<CR>:bot copen<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gp', ':Ggrep<space>', opts)
|
||||
vim.keymap.set('n', '<leader>gm', ':Gmove<space>', opts)
|
||||
vim.keymap.set('n', '<leader>gb', ':Git branch<Space>', opts)
|
||||
vim.keymap.set('n', '<leader>go', ':Git checkout<Space>', opts)
|
||||
vim.keymap.set('n', '<leader>gps', ':Git push<CR>', opts)
|
||||
vim.keymap.set('n', '<leader>gpl', ':Dispatch! git pull<CR>', opts)
|
||||
-- Interactive merge conflict SPAVE-mv to trigger from git status menu
|
||||
vim.keymap.set('n', '<leader>gj', ':diffget //3<Space>', opts)
|
||||
vim.keymap.set('n', '<leader>gf', ':diffget //2<Space>', opts)
|
||||
-- TELESCOPE
|
||||
vim.keymap.set('n', '<leader>rg', require('telescope.builtin').live_grep, opts)
|
||||
vim.keymap.set('n', '<leader>pw', require('telescope.builtin').grep_string, opts)
|
||||
vim.keymap.set('n', '<leader>pf', require('telescope.builtin').find_files, opts)
|
||||
vim.keymap.set('n', '<leader>pg', require('telescope.builtin').git_files, opts)
|
||||
vim.keymap.set('n', '<leader>pb', require('telescope.builtin').buffers, opts)
|
||||
vim.keymap.set('n', '<leader>m', require('telescope.builtin').man_pages, opts)
|
||||
vim.keymap.set('n', '<leader>pc', require('telescope.builtin').current_buffer_fuzzy_find, opts)
|
||||
vim.keymap.set('n', '<leader>tg', require('telescope.builtin').live_grep, opts)
|
||||
vim.keymap.set('n', '<leader>gl', require('telescope.builtin').git_bcommits, opts)
|
||||
vim.keymap.set('n', '<leader>gk', require('telescope.builtin').git_commits, opts)
|
||||
-- kenesis
|
||||
vim.keymap.set('n', '<leader>th', require('telescope.builtin').grep_string, opts)
|
||||
vim.keymap.set('n', '<leader>tj', require('telescope.builtin').find_files, opts)
|
||||
vim.keymap.set('n', '<leader>tk', require('telescope.builtin').git_files, opts)
|
||||
vim.keymap.set('n', '<leader>tm', require('telescope.builtin').buffers, opts)
|
||||
vim.keymap.set('n', '<leader>t;', require('telescope.builtin').help_tags, opts)
|
||||
vim.keymap.set('n', '<leader>tl', require('telescope.builtin').current_buffer_fuzzy_find, opts)
|
||||
-- for debugger
|
||||
-- vim.keymap.set('n', '<Leader>tp', '<Cmd>:Telescope dap list_breakpoints<CR>', opts)
|
||||
-- vim.keymap.set('n', '<Leader>tc', '<Cmd>:Telescope dap commands<CR>', opts)
|
||||
|
||||
-- Harpoon
|
||||
vim.keymap.set('n', '<space>ha', '<cmd>lua require("harpoon.mark").add_file()<CR>', opts)
|
||||
vim.keymap.set('n', '<space>hj', '<cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>', opts)
|
||||
vim.keymap.set('n', '<space>hn', '<cmd>lua require("harpoon.ui").nav_next()<CR>', opts)
|
||||
vim.keymap.set('n', '<space>hp', '<cmd>lua require("harpoon.ui").nav_prev()<CR>', opts)
|
||||
vim.keymap.set('n', '<space>h1', '<cmd>lua require("harpoon.ui").nav_file(1)<CR>', opts)
|
||||
vim.keymap.set('n', '<space>h2', '<cmd>lua require("harpoon.ui").nav_file(2)<CR>', opts)
|
||||
vim.keymap.set('n', '<space>h3', '<cmd>lua require("harpoon.ui").nav_file(3)<CR>', opts)
|
||||
vim.keymap.set('n', '<space>h4', '<cmd>lua require("harpoon.ui").nav_file(4)<CR>', opts)
|
||||
|
||||
vim.keymap.set('n', '<space>sn', '<cmd>:PackerSync<CR>', opts)
|
||||
|
||||
-- DEBUG
|
||||
vim.keymap.set('n', '<F5>', '<Cmd>lua require("dap").continue()<CR>', opts)
|
||||
vim.keymap.set('n', '<F10>', '<Cmd>lua require("dap").step_over()<CR>', opts)
|
||||
vim.keymap.set('n', '<F11>', '<Cmd>lua require("dap").step_into()<CR>', opts)
|
||||
vim.keymap.set('n', '<F12>', '<Cmd>lua require("dap").step_out()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>b', '<Cmd>lua require("dap").toggle_breakpoint()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>B', '<Cmd>lua require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>lp', '<Cmd>lua require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: "))<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>dr', '<Cmd>lua require("dap").repl.open()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>dl', '<Cmd>lua require("dap").run_last()<CR>', opts)
|
||||
vim.keymap.set('n', '<Leader>dc', '<Cmd>lua require("dapui").close()<CR>', opts)
|
||||
|
||||
--unbinds
|
||||
-- vim.keymap.set('n', 'b', '<Nop>', opts)
|
26
init.lua
26
init.lua
|
@ -110,7 +110,7 @@ require('lazy').setup({
|
|||
},
|
||||
|
||||
-- Useful plugin to show you pending keybinds.
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{ 'folke/which-key.nvim', opts = {} },
|
||||
{
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
'lewis6991/gitsigns.nvim',
|
||||
|
@ -218,8 +218,8 @@ require('lazy').setup({
|
|||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
||||
-- These are some example plugins that I've included in the kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them.
|
||||
-- require 'kickstart.plugins.autoformat',
|
||||
-- require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.autoformat',
|
||||
require 'kickstart.plugins.debug',
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
|
||||
|
@ -227,7 +227,7 @@ require('lazy').setup({
|
|||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
--
|
||||
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
||||
-- { import = 'custom.plugins' },
|
||||
{ import = 'custom.plugins' },
|
||||
}, {})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
|
@ -333,7 +333,8 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
|
|||
vim.defer_fn(function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
|
||||
'bash' },
|
||||
|
||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||
auto_install = false,
|
||||
|
@ -472,12 +473,17 @@ require('mason-lspconfig').setup()
|
|||
-- If you want to override the default filetypes that your language server will attach to you can
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
tsserver = {},
|
||||
eslint = {},
|
||||
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
||||
yamlls = {},
|
||||
terraformls = {},
|
||||
jsonls = {},
|
||||
dockerls = {},
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "a4de64570b9620875c8ea04175cd07ed8e32ac99" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"github-nvim-theme": { "branch": "main", "commit": "48f95f763e1a98e508260a20e448c3ff2d91213a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" },
|
||||
"harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" },
|
||||
"mason.nvim": { "branch": "main", "commit": "eabf6d347fdb75be360d4c0ced1145670a171453" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "80487e4f7bfa11c2ef2a1b461963db019aad6a73" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
|
||||
"nvim-dap": { "branch": "master", "commit": "4048f37bc8b1a36fe1f5fde0df7d84aef71380e4" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b44737605807023d32e6310b87ba69f4dbf10e0e" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "bef2c24e23d0da62a8542b1f08b1ac87ec43e93f" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "b9acd92ded2ba155867ca5af9d618e933d96e3b0" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"vim-be-good": { "branch": "master", "commit": "c290810728a4f75e334b07dc0f3a4cdea908d351" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
"projekt0n/github-nvim-theme",
|
||||
'ThePrimeagen/vim-be-good',
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
dependancies = { { 'nvim-lua/plenary.nvim' } }
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue