diff --git a/init.lua b/init.lua index d8fa26dd..264d3b82 100644 --- a/init.lua +++ b/init.lua @@ -26,6 +26,17 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). + { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + }, { 'pmizio/typescript-tools.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, @@ -502,14 +513,10 @@ require('lazy').setup({ }, }, }, - pylsp = { - plugins = { - ruff = { - enabled = true, - formatEnabled = true, - }, - autopep8 = { enabled = false }, - }, + pyright = {}, + ruff = { + enabled = true, + formatEnabled = true, }, cmake = {}, lua_ls = { diff --git a/keymap.lua b/keymap.lua new file mode 100644 index 00000000..7e57c2c5 --- /dev/null +++ b/keymap.lua @@ -0,0 +1,47 @@ +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` + +-- Set highlight on search, but clear on pressing in normal mode + +vim.keymap.set('n', 'mt', 'NvimTreeFocus') +vim.keymap.set('n', '', 'ClangdSwitchSourceHeader', { desc = 'Swith to source/header file' }) +vim.keymap.set('n', '', 'nohlsearch') +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +vim.keymap.set('n', 'z', require('telescope').extensions.zoxide.list, { desc = '[Z]oxide to different dir' }) +vim.keymap.set('n', 'jl', require('telescope.builtin').jumplist, { desc = '[J]ump [L]ist' }) +vim.keymap.set('n', 'ft', function() + vim.g.disable_format = not vim.g.disable_autoformat +end, { desc = 'Auto[F]ormat [T]oggle ' }) +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- TIP: Disable arrow keys in normal mode +-- vim.keymap.set('n', '', 'echo "Use h to move!!"') +-- vim.keymap.set('n', '', 'echo "Use l to move!!"') +-- vim.keymap.set('n', '', 'echo "Use k to move!!"') +-- vim.keymap.set('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + +-- Tmux jump between tmux and nvim with nvim keybindings +vim.keymap.set('n', '', 'TmuxNavigateLeft', { desc = 'Move to left pane in tumx' }) +vim.keymap.set('n', '', 'TmuxNavigateDown', { desc = 'Move to down pane in tumx' }) +vim.keymap.set('n', '', 'TmuxNavigateUp', { desc = 'Move to up pane in tumx' }) +vim.keymap.set('n', '', 'TmuxNavigateRight', { desc = 'Move to right pane in tumx' }) +vim.keymap.set('n', '', 'TmuxNavigatePrevious', { desc = 'Move to last pane in tumx' })