nixos-config/pkgs/bck-nvim/lua/9-misc.lua

42 lines
1.3 KiB
Lua
Raw Permalink Normal View History

2024-02-23 05:14:23 +00:00
vim.cmd("set mouse=")
vim.cmd("set number relativenumber")
vim.cmd("set nowrap")
vim.cmd("set scrolloff=9")
vim.cmd("set tabstop=4")
vim.cmd("set shiftwidth=4")
vim.cmd("set ignorecase smartcase")
2024-07-26 01:24:28 +00:00
vim.cmd("set clipboard=unnamedplus")
2024-02-23 05:14:23 +00:00
vim.keymap.set('n', '<space>ff', '<cmd>Telescope find_files<cr>')
vim.keymap.set('n', '<space>fr', '<cmd>Telescope oldfiles<cr>')
vim.keymap.set('n', '<space>fg', '<cmd>Telescope git_files<cr>')
vim.keymap.set('n', '>', '>>^')
vim.keymap.set('n', '<', '<<^')
vim.keymap.set('v', '<', '<gv^')
vim.keymap.set('v', '>', '>gv^')
vim.keymap.set('n', '<space>w', '<cmd>w<cr>')
vim.keymap.set('n', '<space>q', '<cmd>q<cr>')
vim.keymap.set('n', '<space>c', '<cmd>:bdelete<cr>')
2024-03-19 23:34:42 +00:00
vim.keymap.set('n', '<A-j>', '<cmd>bprevious<cr>')
vim.keymap.set('n', '<A-k>', '<cmd>bnext<cr>')
2024-02-23 05:14:23 +00:00
vim.keymap.set('n', "<C-Up>", "<cmd>resize -2<cr>")
vim.keymap.set('n', "<C-Down>", "<cmd>resize +2<cr>")
vim.keymap.set('n', "<C-Left>", "<cmd>vertical resize -2<cr>")
vim.keymap.set('n', "<C-Right>", "<cmd>vertical resize +2<cr>")
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end
})
local fname = os.getenv("HOME") .. "/.bck-nvim.lua"
local f = io.open(fname, "r")
if f ~= nil then
io.close(f)
vim.cmd('luafile ' .. fname)
end