local set = vim.opt
local map = vim.api.nvim_set_keymap
local default_opts = { noremap = true, silent = true }
map('n', 'k', 'j', default_opts)
map('n', '<C-w>k', '<C-w>j', default_opts)
map('n', '<C-w><C-k>', '<C-w>j', default_opts )
map('n', 'j', 'k', default_opts)
map('n', '<C-w>j', '<C-w>k', default_opts)
map('n', '<C-w><C-j>', '<C-w>k', default_opts)
require("lazynvim")
require('lualine').setup()
require('mini.move').setup({
mappings = {
-- Move visual selection in Visual mode. Defaults are Alt (Meta) + hjkl.
left = '<M-h>',
right = '<M-l>',
down = '<M-k>',
up = '<M-j>',
-- Move current line in Normal mode
line_left = '<M-h>',
line_right = '<M-l>',
line_down = '<M-k>',
line_up = '<M-j>',
},
-- Options which control moving behavior
options = {
-- Automatically reindent selection during linewise vertical move
reindent_linewise = true,
},
})
require("plug-neorg")
vim.cmd [[colorscheme tokyonight-storm]]
-- Set the behavior of tab
set.title = true
set.number = true
set.tabstop = 3
set.shiftwidth = 3
set.softtabstop = 3
set.expandtab = true
set.smartindent = true
set.colorcolumn = '80'
set.cursorline = true
set.showmatch = true -- highlight matching parenthesis
set.ignorecase = true -- ignore case letters when search
set.smartcase = true -- ignore lowercase for the whole pattern
set.linebreak = true -- wrap on word boundary
set.swapfile = false
set.listchars = {eol = '↲', tab = '▸ ', trail = '·'}
set.list = true
map('v', 'v', '0', default_opts)
map('v', 'x', '1j$', default_opts)
map('v', '<S-x>', '1k$', default_opts)
-------- Quick Saving ---------
map('n', '<C-s>', ':w<CR>', default_opts)
map('i', '<C-s>', '<ESC><C-c>:w<CR>', default_opts)
--------- Qucik Exit ----------
map('i', '<C-q>', '<ESC>:NvimTreeClose, <C-c:q<CR>>', default_opts)
map('n', '<C-q>', ':q<CR>', default_opts)
--------- Tab Handling --------
map('n', '<C-t>', ':tabnew<CR>', default_opts)
map('n', '<C-Right>', ':tabn<CR>', default_opts)
map('n', '<C-Left>', ':tabp<CR>', default_opts)
map('i', '<C-t>', '<ESC>:tabnew<CR>', default_opts)
map('i', '<C-Right>', '<ESC>:tabn<CR>', default_opts)
map('i', '<C-Left>', '<ESC>:tabp<CR>', default_opts)
map('v', '<C-t>', '<ESC>:tabnew<CR>', default_opts)
map('v', '<C-Right>', '<ESC>:tabn<CR>', default_opts)
map('v', '<C-Left>', '<ESC>:tabp<CR>', default_opts)
-------- Nvim Tree Toggle ------
map('n', '<F1>', ':NvimTreeToggle<CR>', default_opts)
map('n', '<A-Right>', ':bnext<CR>', default_opts)
map('n', '<A-Left>', ':bprevious<CR>', default_opts)
------- Kommentary ------
--g.kommentary_create_default_mappings = false
map("n", "<C-k>", "<Plug>kommentary_line_default", {})
map("v", "<C-k>", "<Plug>kommentary_visual_default<C-c>", {})