use new nvim 0.7 functions
This commit is contained in:
parent
651e05c30a
commit
42593f71e5
4 changed files with 26 additions and 52 deletions
|
@ -1,41 +1,38 @@
|
|||
local map = require("utils").map
|
||||
-- search for visual selection
|
||||
map {'v', '//', 'y/<C-R>"<CR>'}
|
||||
map {'n', 'H', '^'}
|
||||
vim.keymap.set('v', '//', 'y/<C-R>"<CR>')
|
||||
vim.keymap.set('n', 'H', '^')
|
||||
|
||||
|
||||
-- ex command
|
||||
map {'c', '<C-p>', '<Up>'}
|
||||
map {'c', '<C-n>', '<Down>'}
|
||||
vim.keymap.set('c', '<C-p>', '<Up>')
|
||||
vim.keymap.set('c', '<C-n>', '<Down>')
|
||||
|
||||
-- auto expand brackets
|
||||
map {'i', '(;', '(<CR>)<C-c>O'}
|
||||
map {'i', '(,', '(<CR>),<C-c>O'}
|
||||
map {'i', '{;', '{<CR>}<C-c>O'}
|
||||
map {'i', '{,', '{<CR>},<C-c>O'}
|
||||
map {'i', '[;', '[<CR>]<C-c>O'}
|
||||
map {'i', '[,', '[<CR>],<C-c>O'}
|
||||
vim.keymap.set('i', '(;', '(<CR>)<C-c>O')
|
||||
vim.keymap.set('i', '(,', '(<CR>),<C-c>O')
|
||||
vim.keymap.set('i', '{;', '{<CR>}<C-c>O')
|
||||
vim.keymap.set('i', '{,', '{<CR>},<C-c>O')
|
||||
vim.keymap.set('i', '[;', '[<CR>]<C-c>O')
|
||||
vim.keymap.set('i', '[,', '[<CR>],<C-c>O')
|
||||
|
||||
-- toggle hybrid mode
|
||||
map {'n', '<leader>h', ':set rnu!<CR>'}
|
||||
vim.keymap.set('n', '<leader>h', ':set rnu!<CR>')
|
||||
|
||||
-- nvim-tree.lua
|
||||
map {'n', '<leader>e', ':NvimTreeToggle<CR>'}
|
||||
vim.keymap.set('n', '<leader>e', ':NvimTreeToggle<CR>')
|
||||
|
||||
-- Telescope
|
||||
map {'n', '<C-y>', '<cmd>Telescope buffers<CR>'}
|
||||
map {'n', '<leader>f', '<cmd>Telescope find_files<CR>'}
|
||||
map {'n', '<leader>l', '<cmd>Telescope live_grep<CR>'}
|
||||
map {'n', '<silent> gy', '<cmd>Telescope treesitter<CR>'}
|
||||
vim.keymap.set('n', '<C-y>', '<cmd>Telescope buffers<CR>')
|
||||
vim.keymap.set('n', '<leader>f', '<cmd>Telescope find_files<CR>')
|
||||
vim.keymap.set('n', '<leader>l', '<cmd>Telescope live_grep<CR>')
|
||||
vim.keymap.set('n', '<silent> gy', '<cmd>Telescope treesitter<CR>')
|
||||
|
||||
map {'n', '<leader>wm', '<cmd>lua require("notes").list()<CR>'}
|
||||
map {'n', '<leader>wt', '<cmd>lua require("notes").tags()<CR>'}
|
||||
vim.keymap.set('n', '<leader>wm', require("notes").list)
|
||||
vim.keymap.set('n', '<leader>wt', require("notes").tags)
|
||||
|
||||
-- neo formatter
|
||||
map {'n', '<leader>p', ':Neoformat<CR>'}
|
||||
|
||||
-- goyo mapping
|
||||
map {'n', '<silent> <leader>w', ':Goyo<CR>'}
|
||||
vim.keymap.set('n', '<leader>p', ':Neoformat<CR>')
|
||||
|
||||
-- spelling
|
||||
map {'n', '<silent> <leader>se', ':set spell spelllang=en<CR>'}
|
||||
map {'n', '<silent> <leader>sd', ':set spell spelllang=de<CR>'}
|
||||
vim.keymap.set('n', '<silent> <leader>se', ':set spell spelllang=en<CR>')
|
||||
vim.keymap.set('n', '<silent> <leader>sd', ':set spell spelllang=de<CR>')
|
||||
|
|
|
@ -2,15 +2,14 @@
|
|||
|
||||
-- syntax
|
||||
vim.cmd [[
|
||||
syntax on
|
||||
let mapleader = " "
|
||||
colorscheme sonokai
|
||||
hi MatchParen guibg=NONE guifg=red gui=bold
|
||||
set shortmess+=c
|
||||
colorscheme sonokai
|
||||
]]
|
||||
|
||||
-- color settings
|
||||
vim.opt.termguicolors=true
|
||||
vim.g.do_filetype_lua = 1
|
||||
|
||||
-- random settings
|
||||
vim.opt.number = true
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
-- PLUGIN OPTIONS
|
||||
|
||||
|
||||
-- GITGUTTER SETUP
|
||||
-- =========================
|
||||
vim.api.nvim_set_var('gitgutter_sign_added', '∙')
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
local M = {}
|
||||
function M.map(key)
|
||||
-- get the extra options
|
||||
local opts = {noremap = true}
|
||||
for i, v in pairs(key) do
|
||||
if type(i) == 'string' then opts[i] = v end
|
||||
end
|
||||
|
||||
-- basic support for buffer-scoped keybindings
|
||||
local buffer = opts.buffer
|
||||
opts.buffer = nil
|
||||
|
||||
if buffer then
|
||||
vim.api.nvim_buf_set_keymap(0, key[1], key[2], key[3], opts)
|
||||
else
|
||||
vim.api.nvim_set_keymap(key[1], key[2], key[3], opts)
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Reference in a new issue