pull/1710/head
Daniel B Sherry 1 week ago
parent cf673381c5
commit a9aead8bd6

@ -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.

@ -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/<your_github_username>/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 `<your_github_username>` in the commands below
<details><summary> Linux and Mac </summary>
```sh
git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```
</details>
<details><summary> Windows </summary>
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"
```
</details>
### 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
<details><summary>Windows with Microsoft C++ Build Tools and CMake</summary>
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' }
```
</details>
<details><summary>Windows with gcc/make using chocolatey</summary>
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
```
</details>
<details><summary>WSL (Windows Subsystem for Linux)</summary>
```
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
```
</details>
#### Linux Install
<details><summary>Ubuntu Install Steps</summary>
```
sudo add-apt-repository ppa:neovim-ppa/unstable -y
sudo apt update
sudo apt install make gcc ripgrep unzip git xclip neovim
```
</details>
<details><summary>Debian Install Steps</summary>
```
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/
```
</details>
<details><summary>Fedora Install Steps</summary>
```
sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
```
</details>
<details><summary>Arch Install Steps</summary>
```
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
```
</details>

@ -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 = "<M-e>",
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 = "" } })

@ -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 },
})

@ -1,34 +1,34 @@
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",
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
@ -39,9 +39,9 @@ return {
'hrsh7th/cmp-vsnip',
'hrsh7th/vim-vsnip',
'rafamadriz/friendly-snippets',
}
},
{ 'mfussenegger/nvim-lint', },
},
{ 'mfussenegger/nvim-lint' },
{ 'mfussenegger/nvim-dap' },
{ 'mhartington/formatter.nvim' }
{ 'mhartington/formatter.nvim' },
}

@ -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("<leader>fs", tele.lsp_document_symbols, "Doc Symbols")
map("<leader>fS", tele.lsp_dynamic_workspace_symbols, "Dynamic Symbols")
map("<leader>ft", tele.lsp_type_definitions, "Goto Type")
map("<leader>fr", tele.lsp_references, "Goto References")
map("<leader>fi", tele.lsp_implementations, "Goto Impl")
map('gd', tele.lsp_definitions, 'Goto Definition')
map('<leader>fs', tele.lsp_document_symbols, 'Doc Symbols')
map('<leader>fS', tele.lsp_dynamic_workspace_symbols, 'Dynamic Symbols')
map('<leader>ft', tele.lsp_type_definitions, 'Goto Type')
map('<leader>fr', tele.lsp_references, 'Goto References')
map('<leader>fi', tele.lsp_implementations, 'Goto Impl')
map("K", vim.lsp.buf.hover, "Hover Docs")
map("<leader>E", vim.diagnostic.open_float, "Diagnostics")
map("<leader>k", vim.lsp.buf.signature_help, "Signature Help")
map("<leader>rn", vim.lsp.buf.rename, "Rename")
map("<leader>ca", vim.lsp.buf.code_action, "Code Action")
map("<leader>wf", function()
vim.lsp.buf.format({ async = true })
end, "Format")
map('K', vim.lsp.buf.hover, 'Hover Docs')
map('<leader>E', vim.diagnostic.open_float, 'Diagnostics')
map('<leader>k', vim.lsp.buf.signature_help, 'Signature Help')
map('<leader>rn', vim.lsp.buf.rename, 'Rename')
map('<leader>ca', vim.lsp.buf.code_action, 'Code Action')
map('<leader>wf', function()
vim.lsp.buf.format { async = true }
end, 'Format')
vim.keymap.set("v", "<leader>ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Lsp: Code Action" })
vim.keymap.set('v', '<leader>ca', vim.lsp.buf.code_action, { buffer = ev.buf, desc = 'Lsp: Code Action' })
end,
})
end,

@ -0,0 +1,18 @@
return {
'christoomey/vim-tmux-navigator',
cmd = {
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
'TmuxNavigatePrevious',
'TmuxNavigatorProcessList',
},
keys = {
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
},
}

@ -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 = {
{
"<leader>?",
'<leader>?',
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)',
},
},
}

@ -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('', '<Space>', '<Nop>', opts)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
@ -25,23 +22,26 @@ keymap('n', '<C-j>', '<C-w>j', opts)
keymap('n', '<C-k>', '<C-w>k', opts)
keymap('n', '<C-l>', '<C-w>l', opts)
keymap('n', '<leader>e', ':Lex 30<cr>', opts) -- hit again to close
keymap('n', '<leader>e', ':Lex 34<cr>', opts) -- hit again to close
-- Resize with arrows
keymap('n', '<C-Up>', ':resize +2<CR>', opts)
keymap('n', '<C-Down>', ':resize -2<CR>', opts)
keymap('n', '<C-Left>', ':vertical resize -2<CR>', opts)
keymap('n', '<C-Right>', ':vertical resize +2<CR>', opts)
keymap('n', '<C-Up>', ':resize +6<CR>', opts)
keymap('n', '<C-Down>', ':resize 2<CR>', opts)
keymap('n', '<C-Left>', ':vertical resize 2<CR>', opts)
keymap('n', '<C-Right>', ':vertical resize +6<CR>', opts)
-- Navigate buffers
keymap('n', '<S-l>', ':bnext<CR>', opts)
keymap("n", "<leader>n", ":bnext<CR>", opts)
keymap('n', '<S-h>', ':bprevious<CR>', opts)
keymap("n", "<leader>p", ":bprev<CR>", opts)
-- keymap('n', '<S-l>', ':bnext<CR>', opts)
vim.keymap.set('n', '<S-l>', ':bnext<CR>', opts)
vim.keymap.set('n', '<S-h>', ':bprev<CR>', opts)
keymap('n', '<leader>n', ':bnext<CR>', opts)
-- keymap('n', '<S-h>', ':bprevious<CR>', opts)
keymap('n', '<leader>p', ':bprev<CR>', opts)
-- Insert --
-- Press fast to exit
keymap('i', 'jk', '<ESC>', opts)
-- keymap('i', 'jk', '<ESC>', opts)
-- Jump to beginning of line
keymap('n', '<leader>h', '^', opts)
@ -50,49 +50,42 @@ keymap('n', '<leader>h', '^', opts)
-- Stay in indent mode
keymap('v', '<', '<gv', opts)
keymap('v', '>', '>gv', opts)
-- Move text up and down
keymap('v', '<A-j>', ':m .+1<CR>==', opts)
keymap('v', '<A-k>', ':m .-2<CR>==', 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 '>+5<CR>gv-gv", opts)
-- keymap('x', 'K', ":move '<2<CR>gv-gv", opts)
keymap('v', '<A-j>', ':m .+1<CR>==', opts)
keymap('v', '<A-k>', ':m .-2<CR>==', opts)
keymap('x', 'J', ":move '>+1<CR>gv-gv", opts)
keymap('x', 'K', ":move '<-2<CR>gv-gv", opts)
keymap('x', '<A-j>', ":move '>+1<CR>gv-gv", opts)
keymap('x', '<A-k>', ":move '<-2<CR>gv-gv", opts)
-- Terminal --
-- Better terminal navigation
keymap('t', '<C-h>', '<C-\\><C-N><C-w>h', term_opts)
keymap('t', '<C-j>', '<C-\\><C-N><C-w>j', term_opts)
keymap('t', '<C-k>', '<C-\\><C-N><C-w>k', term_opts)
keymap('t', '<C-l>', '<C-\\><C-N><C-w>l', term_opts)
-- keymap("n", "<leader>f", "<cmd>Telescope find_files<cr>", opts)
keymap("n", "<leader>f", "<cmd>lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))<cr>", opts)
keymap("n", "<c-t>", "<cmd>Telescope live_grep<cr>", opts)
--
-- See `:help telescope.builtin`
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
keymap('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
keymap('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
keymap('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
keymap('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
keymap('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
keymap('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
keymap('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
keymap('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
keymap('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
keymap('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
keymap('n', '<leader>/', 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', '<leader>sn', function()
end, { desc = '[S]earch [N]eovim files' })
-- Nvimtree
keymap("n", "<leader>e", ":NvimTreeToggle<cr>", opts)
keymap('n', '<leader>e', ':NvimTreeToggle<cr>', opts)
-- keymap("n", "<leader>f", ":Format<cr>", opts)
keymap("n", "<leader>w", ":w<cr>", opts)
keymap("n", "<leader>q", ":q<cr>", opts)
keymap("n", "<leader>d", ":bdelete<cr>", opts)
keymap('n', '<leader>w', ':w<cr>', opts)
keymap('n', '<leader>q', ':q<cr>', opts)
keymap('n', '<leader>d', ':bdelete<cr>', opts)
keymap("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts)
keymap('n', '<C-d>', '<C-d>zz', opts)
keymap('n', '<C-u>', '<C-u>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", "<C-a>", "ggVG", opts)
vim.keymap.set('n', '<c-a>', 'ggvg', opts)
-- vim.keymap.set('n', 'YY', 'va{Vy', opts)
keymap('n', '<leader>r', ':w<CR>:!python3 %<CR>', { noremap = true, silent = true })
-- vim.keymap.set('n', '<leader><leader>x', ':source %<CR>', opts)
keymap('n', '<leader>x', ':.lua<CR>', opts)
keymap('v', '<leader>x', ':lua<CR>', opts)
vim.keymap.set("n", "YY", "va{Vy", opts)
vim.keymap.set("n", "<leader>r", ":w<CR>:!python3 %<CR>", { noremap = true, silent = true })
vim.keymap.set("n", "<leader><leader>x", ":source %<CR>", opts)
vim.keymap.set("n", "<leader>x", ":.lua<CR>", opts)
vim.keymap.set("v", "<leader>x", ":lua<CR>", opts)
-- undo word by word
vim.keymap.set('i', '<space>', '<C-G>u<space>', opts)

@ -0,0 +1,6 @@
def add(a, b) -> int:
return a + b
if __name__ == "__main__":
print(add(2, 8))

@ -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))
Loading…
Cancel
Save