diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index 9cf10627..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md deleted file mode 100644 index 800ca990..00000000 --- a/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# kickstart.nvim - -## Introduction - -A starting point for Neovim that is: - -* Small -* Single-file -* Completely Documented - -**NOT** a Neovim distribution, but instead a starting point for your configuration. - -## Installation - -### Install Neovim - -Kickstart.nvim targets *only* the latest -['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest -['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. -If you are experiencing issues, please make sure you have the latest versions. - -### Install External Dependencies - -External Requirements: -- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) -- [ripgrep](https://github.com/BurntSushi/ripgrep#installation) -- Clipboard tool (xclip/xsel/win32yank or other depending on platform) -- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - - if you have it set `vim.g.have_nerd_font` in `init.lua` to true -- Language Setup: - - If you want to write Typescript, you need `npm` - - If you want to write Golang, you will need `go` - - etc. - -> **NOTE** -> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes -> and quick install snippets - -### Install Kickstart - -> **NOTE** -> [Backup](#FAQ) your previous configuration (if any exists) - -Neovim's configurations are located under the following paths, depending on your OS: - -| OS | PATH | -| :- | :--- | -| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%localappdata%\nvim\` | -| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | - -#### Recommended Step - -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo -so that you have your own copy that you can modify, then install by cloning the -fork to your machine using one of the commands below, depending on your OS. - -> **NOTE** -> Your fork's url will be something like this: -> `https://github.com//kickstart.nvim.git` - -You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file -too - it's ignored in the kickstart repo to make maintenance easier, but it's -[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile). - -#### Clone kickstart.nvim -> **NOTE** -> If following the recommended step above (i.e., forking the repo), replace -> `nvim-lua` with `` in the commands below - -
Linux and Mac - -```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim -``` - -
- -
Windows - -If you're using `cmd.exe`: - -``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" -``` - -If you're using `powershell.exe` - -``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" -``` - -
- -### Post Installation - -Start Neovim - -```sh -nvim -``` - -That's it! Lazy will install all the plugins you have. Use `:Lazy` to view -current plugin status. Hit `q` to close the window. - -Read through the `init.lua` file in your configuration folder for more -information about extending and exploring Neovim. That also includes -examples of adding popularly requested plugins. - - -### Getting Started - -[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o) - -### FAQ - -* What should I do if I already have a pre-existing neovim configuration? - * You should back it up and then delete all associated files. - * This includes your existing init.lua and the neovim files in `~/.local` - which can be deleted with `rm -rf ~/.local/share/nvim/` -* Can I keep my existing configuration in parallel to kickstart? - * Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` - to maintain multiple configurations. For example, you can install the kickstart - configuration in `~/.config/nvim-kickstart` and create an alias: - ``` - alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim' - ``` - When you run Neovim using `nvim-kickstart` alias it will use the alternative - config directory and the matching local directory - `~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim - distribution that you would like to try out. -* What if I want to "uninstall" this configuration: - * See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information -* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files? - * The main purpose of kickstart is to serve as a teaching tool and a reference - configuration that someone can easily use to `git clone` as a basis for their own. - As you progress in learning Neovim and Lua, you might consider splitting `init.lua` - into smaller parts. A fork of kickstart that does this while maintaining the - same functionality is available here: - * [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) - * Discussions on this topic can be found here: - * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218) - * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473) - -### Install Recipes - -Below you can find OS specific install instructions for Neovim and dependencies. - -After installing all the dependencies continue with the [Install Kickstart](#Install-Kickstart) step. - -#### Windows Installation - -
Windows with Microsoft C++ Build Tools and CMake -Installation may require installing build tools and updating the run command for `telescope-fzf-native` - -See `telescope-fzf-native` documentation for [more details](https://github.com/nvim-telescope/telescope-fzf-native.nvim#installation) - -This requires: - -- Install CMake and the Microsoft C++ Build Tools on Windows - -```lua -{'nvim-telescope/telescope-fzf-native.nvim', build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' } -``` -
-
Windows with gcc/make using chocolatey -Alternatively, one can install gcc and make which don't require changing the config, -the easiest way is to use choco: - -1. install [chocolatey](https://chocolatey.org/install) -either follow the instructions on the page or use winget, -run in cmd as **admin**: -``` -winget install --accept-source-agreements chocolatey.chocolatey -``` - -2. install all requirements using choco, exit previous cmd and -open a new one so that choco path is set, and run in cmd as **admin**: -``` -choco install -y neovim git ripgrep wget fd unzip gzip mingw make -``` -
-
WSL (Windows Subsystem for Linux) - -``` -wsl --install -wsl -sudo add-apt-repository ppa:neovim-ppa/unstable -y -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim -``` -
- -#### Linux Install -
Ubuntu Install Steps - -``` -sudo add-apt-repository ppa:neovim-ppa/unstable -y -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip neovim -``` -
-
Debian Install Steps - -``` -sudo apt update -sudo apt install make gcc ripgrep unzip git xclip curl - -# Now we install nvim -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -sudo rm -rf /opt/nvim-linux64 -sudo mkdir -p /opt/nvim-linux64 -sudo chmod a+rX /opt/nvim-linux64 -sudo tar -C /opt -xzf nvim-linux64.tar.gz - -# make it available in /usr/local/bin, distro installs to /usr/bin -sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/ -``` -
-
Fedora Install Steps - -``` -sudo dnf install -y gcc make git ripgrep fd-find unzip neovim -``` -
- -
Arch Install Steps - -``` -sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim -``` -
- diff --git a/Saved/autopairs.lua b/Saved/autopairs.lua deleted file mode 100644 index 577e571e..00000000 --- a/Saved/autopairs.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Setup nvim-cmp. -local status_ok, npairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end - -npairs.setup { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, -} - -local cmp_autopairs = require "nvim-autopairs.completion.cmp" -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end -cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } }) diff --git a/Saved/lazy.lua b/Saved/lazy.lua deleted file mode 100644 index efda595e..00000000 --- a/Saved/lazy.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - --- Make sure to setup `mapleader` and `maplocalleader` before --- loading lazy.nvim so that mappings are correct. --- This is also a good place to setup other settings (vim.opt) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- My plugins here - --- Setup lazy.nvim -require("lazy").setup({ - spec = { - -- import your plugins - { import = "plugins" }, - }, - -- Configure any other settings here. See the documentation for more details. - -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, - -- automatically check for plugin updates - checker = { enabled = true }, -}) diff --git a/lua/plugins.lua b/lua/plugins.lua index 4d6d862a..7cfbbdc9 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,47 +1,47 @@ return { { 'folke/tokyonight.nvim' }, - { "nvim-lua/popup.nvim" }, -- An implementation of the Popup API from vim in Neovim - { "nvim-lua/plenary.nvim" }, -- Useful lua functions used ny lots of plugins - { "windwp/nvim-autopairs" }, -- Autopairs + { 'nvim-lua/popup.nvim' }, -- An implementation of the Popup API from vim in Neovim + { 'nvim-lua/plenary.nvim' }, -- Useful lua functions used ny lots of plugins + { 'windwp/nvim-autopairs' }, -- Autopairs -- "numToStr/Comment.nvim" -- Easily comment stuff { 'kyazdani42/nvim-web-devicons' }, -- Colorschemes -- "lunarvim/colorschemes" -- A bunch of colorschemes you can try out - { "lunarvim/darkplus.nvim" }, - { "moll/vim-bbye" }, + { 'lunarvim/darkplus.nvim' }, + { 'moll/vim-bbye' }, -- snippets - { "L3MON4D3/LuaSnip" }, --snippet engine - { "rafamadriz/friendly-snippets" }, -- a bunch of snippets to use - + { 'L3MON4D3/LuaSnip' }, --snippet engine + { 'rafamadriz/friendly-snippets' }, -- a bunch of snippets to use + -- { 'christoomey/vim-tmux-navigator' }, -- tmux & split window navigation -- Telescope - { "nvim-telescope/telescope-media-files.nvim" }, + { 'nvim-telescope/telescope-media-files.nvim' }, -- Treesitter { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate', }, -- "p00f/nvim-ts-rainbow" -- "nvim-treesitter/playground" - { "neovim/nvim-lspconfig" }, - { "williamboman/mason.nvim" }, - { "williamboman/mason-lspconfig.nvim" }, + { 'neovim/nvim-lspconfig' }, + { 'williamboman/mason.nvim' }, + { 'williamboman/mason-lspconfig.nvim' }, { - "hrsh7th/nvim-cmp", - dependencies = { - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'L3MON4D3/LuaSnip', - 'saadparwaiz1/cmp_luasnip', - 'hrsh7th/cmp-vsnip', - 'hrsh7th/vim-vsnip', - 'rafamadriz/friendly-snippets', - } + 'hrsh7th/nvim-cmp', + dependencies = { + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'L3MON4D3/LuaSnip', + 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-vsnip', + 'hrsh7th/vim-vsnip', + 'rafamadriz/friendly-snippets', + }, }, - { 'mfussenegger/nvim-lint', }, + { 'mfussenegger/nvim-lint' }, { 'mfussenegger/nvim-dap' }, - { 'mhartington/formatter.nvim' } + { 'mhartington/formatter.nvim' }, } diff --git a/lua/plugins/lsp-settings.lua b/lua/plugins/lsp-settings.lua index 2ac0bc5b..2a21476f 100644 --- a/lua/plugins/lsp-settings.lua +++ b/lua/plugins/lsp-settings.lua @@ -1,67 +1,67 @@ -- ~/.config/nvim/lua/plugins/custom-lsp.lua return { { - "neovim/nvim-lspconfig", + 'neovim/nvim-lspconfig', dependencies = { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "hrsh7th/cmp-nvim-lsp", + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + 'hrsh7th/cmp-nvim-lsp', }, config = function() -- Setup Mason - require("mason").setup() - require("mason-lspconfig").setup() + require('mason').setup() + require('mason-lspconfig').setup() -- LSPs to enable - -- local servers = { - -- "lua_ls", - -- "ols", - -- "zls", - -- "clangd", - -- "jsonls", - -- "html", - -- "rust_analyzer", - -- "jdtls", - -- "eslint", - -- "pyright", - -- } + local servers = { + 'lua_ls', + 'ols', + 'zls', + 'clangd', + 'jsonls', + 'html', + 'rust_analyzer', + 'jdtls', + 'eslint', + 'pyright', + } - local lspconfig = require("lspconfig") - local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require 'lspconfig' + local capabilities = require('cmp_nvim_lsp').default_capabilities() - -- for _, server in ipairs(servers) do - -- lspconfig[server].setup({ - -- capabilities = capabilities, - -- }) - -- end + for _, server in ipairs(servers) do + lspconfig[server].setup { + capabilities = capabilities, + } + end -- Autocommand for keymaps - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), + vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), callback = function(ev) local map = function(keys, func, desc) - vim.keymap.set("n", keys, func, { buffer = ev.buf, desc = "Lsp: " .. desc }) + vim.keymap.set('n', keys, func, { buffer = ev.buf, desc = 'Lsp: ' .. desc }) end - local tele = require("telescope.builtin") + local tele = require 'telescope.builtin' - map("gd", tele.lsp_definitions, "Goto Definition") - map("fs", tele.lsp_document_symbols, "Doc Symbols") - map("fS", tele.lsp_dynamic_workspace_symbols, "Dynamic Symbols") - map("ft", tele.lsp_type_definitions, "Goto Type") - map("fr", tele.lsp_references, "Goto References") - map("fi", tele.lsp_implementations, "Goto Impl") + map('gd', tele.lsp_definitions, 'Goto Definition') + map('fs', tele.lsp_document_symbols, 'Doc Symbols') + map('fS', tele.lsp_dynamic_workspace_symbols, 'Dynamic Symbols') + map('ft', tele.lsp_type_definitions, 'Goto Type') + map('fr', tele.lsp_references, 'Goto References') + map('fi', tele.lsp_implementations, 'Goto Impl') - map("K", vim.lsp.buf.hover, "Hover Docs") - map("E", vim.diagnostic.open_float, "Diagnostics") - map("k", vim.lsp.buf.signature_help, "Signature Help") - map("rn", vim.lsp.buf.rename, "Rename") - map("ca", vim.lsp.buf.code_action, "Code Action") - map("wf", function() - vim.lsp.buf.format({ async = true }) - end, "Format") + map('K', vim.lsp.buf.hover, 'Hover Docs') + map('E', vim.diagnostic.open_float, 'Diagnostics') + map('k', vim.lsp.buf.signature_help, 'Signature Help') + map('rn', vim.lsp.buf.rename, 'Rename') + map('ca', vim.lsp.buf.code_action, 'Code Action') + map('wf', function() + vim.lsp.buf.format { async = true } + end, 'Format') - vim.keymap.set("v", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Lsp: Code Action" }) + vim.keymap.set('v', 'ca', vim.lsp.buf.code_action, { buffer = ev.buf, desc = 'Lsp: Code Action' }) end, }) end, diff --git a/lua/plugins/tmux.lua b/lua/plugins/tmux.lua new file mode 100644 index 00000000..26fb72ba --- /dev/null +++ b/lua/plugins/tmux.lua @@ -0,0 +1,18 @@ +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 9fadb977..79eb31ce 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -1,6 +1,6 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", + 'folke/which-key.nvim', + event = 'VeryLazy', opts = { -- your configuration comes here -- or leave it empty to use the default settings @@ -8,11 +8,11 @@ return { }, keys = { { - "?", + '?', function() - require("which-key").show({ global = false }) + require('which-key').show { global = false } end, - desc = "Buffer Local Keymaps (which-key)", + desc = 'Buffer Local Keymaps (which-key)', }, }, } diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index d90e5a53..80708eb9 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -1,11 +1,8 @@ +-- local keymap = vim.api.nvim_set_keymap +local keymap = vim.keymap.set local opts = { noremap = true, silent = true } - local term_opts = { silent = true } --- Shorten function name -local keymap = vim.api.nvim_set_keymap - ---Remap space as leader key keymap('', '', '', opts) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' @@ -25,23 +22,26 @@ keymap('n', '', 'j', opts) keymap('n', '', 'k', opts) keymap('n', '', 'l', opts) -keymap('n', 'e', ':Lex 30', opts) -- hit again to close +keymap('n', 'e', ':Lex 34', opts) -- hit again to close -- Resize with arrows -keymap('n', '', ':resize +2', opts) -keymap('n', '', ':resize -2', opts) -keymap('n', '', ':vertical resize -2', opts) -keymap('n', '', ':vertical resize +2', opts) +keymap('n', '', ':resize +6', opts) +keymap('n', '', ':resize 2', opts) +keymap('n', '', ':vertical resize 2', opts) +keymap('n', '', ':vertical resize +6', opts) -- Navigate buffers -keymap('n', '', ':bnext', opts) -keymap("n", "n", ":bnext", opts) -keymap('n', '', ':bprevious', opts) -keymap("n", "p", ":bprev", opts) +-- keymap('n', '', ':bnext', opts) +vim.keymap.set('n', '', ':bnext', opts) +vim.keymap.set('n', '', ':bprev', opts) + +keymap('n', 'n', ':bnext', opts) +-- keymap('n', '', ':bprevious', opts) +keymap('n', 'p', ':bprev', opts) -- Insert -- -- Press fast to exit -keymap('i', 'jk', '', opts) +-- keymap('i', 'jk', '', opts) -- Jump to beginning of line keymap('n', 'h', '^', opts) @@ -50,49 +50,42 @@ keymap('n', 'h', '^', opts) -- Stay in indent mode keymap('v', '<', '', '>gv', opts) - --- Move text up and down -keymap('v', '', ':m .+1==', opts) -keymap('v', '', ':m .-2==', opts) -- paste over currently selected text without yanking it +-- _ register is black hole. Unrecoverable keymap('v', 'p', '"_dp', opts) keymap('v', 'P', '"_dP', opts) -- Visual Block -- -- Move text up and down +-- keymap('x', 'J', ":move '>+5gv-gv", opts) +-- keymap('x', 'K', ":move '<2gv-gv", opts) +keymap('v', '', ':m .+1==', opts) +keymap('v', '', ':m .-2==', opts) keymap('x', 'J', ":move '>+1gv-gv", opts) keymap('x', 'K', ":move '<-2gv-gv", opts) keymap('x', '', ":move '>+1gv-gv", opts) keymap('x', '', ":move '<-2gv-gv", opts) --- Terminal -- -- Better terminal navigation -keymap('t', '', 'h', term_opts) -keymap('t', '', 'j', term_opts) keymap('t', '', 'k', term_opts) keymap('t', '', 'l', term_opts) - --- keymap("n", "f", "Telescope find_files", opts) -keymap("n", "f", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))", opts) -keymap("n", "", "Telescope live_grep", opts) --- -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' -vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) -vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) -vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) -vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) -vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) -vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) -vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) -vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) -vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) -vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - -vim.keymap.set('n', '/', function() +keymap('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) +keymap('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) +keymap('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) +keymap('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) +keymap('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) +keymap('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) +keymap('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) +keymap('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) +keymap('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) +keymap('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + +keymap('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, + winblend = 14, previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) @@ -112,24 +105,27 @@ vim.keymap.set('n', 'sn', function() end, { desc = '[S]earch [N]eovim files' }) -- Nvimtree -keymap("n", "e", ":NvimTreeToggle", opts) +keymap('n', 'e', ':NvimTreeToggle', opts) -- keymap("n", "f", ":Format", opts) -keymap("n", "w", ":w", opts) -keymap("n", "q", ":q", opts) -keymap("n", "d", ":bdelete", opts) +keymap('n', 'w', ':w', opts) +keymap('n', 'q', ':q', opts) +keymap('n', 'd', ':bdelete', opts) -keymap("n", "", "zz", opts) -keymap("n", "", "zz", opts) +keymap('n', '', 'zz', opts) +keymap('n', '', 'zz', opts) -- Move line on the screen rather than by line in the file -vim.keymap.set("n", "j", "gj", opts) -vim.keymap.set("n", "k", "gk", opts) +keymap('n', 'j', 'gj', opts) +keymap('n', 'k', 'gk', opts) -- Select all -vim.keymap.set("n", "", "ggVG", opts) +vim.keymap.set('n', '', 'ggvg', opts) + +-- vim.keymap.set('n', 'YY', 'va{Vy', opts) +keymap('n', 'r', ':w:!python3 %', { noremap = true, silent = true }) +-- vim.keymap.set('n', 'x', ':source %', opts) +keymap('n', 'x', ':.lua', opts) +keymap('v', 'x', ':lua', opts) -vim.keymap.set("n", "YY", "va{Vy", opts) -vim.keymap.set("n", "r", ":w:!python3 %", { noremap = true, silent = true }) -vim.keymap.set("n", "x", ":source %", opts) -vim.keymap.set("n", "x", ":.lua", opts) -vim.keymap.set("v", "x", ":lua", opts) +-- undo word by word +vim.keymap.set('i', '', 'u', opts) diff --git a/test.py b/test.py new file mode 100644 index 00000000..dab30c30 --- /dev/null +++ b/test.py @@ -0,0 +1,6 @@ +def add(a, b) -> int: + return a + b + + +if __name__ == "__main__": + print(add(2, 8)) diff --git a/tester.py b/tester.py deleted file mode 100644 index aa93b791..00000000 --- a/tester.py +++ /dev/null @@ -1,18 +0,0 @@ -items = [1, 2, 3] - -for i in items: - print(i) - - -def myfunc(x: int) -> str: - "this is a docstring yuhhh" - return f"this is my num {x}" - - -def myfunc2(): - pass - - -print(myfunc(4)) - -print(myfunc(5))