change to new code

This commit is contained in:
Ray Andrew 2024-08-07 20:30:59 -05:00
parent 5a658d4bb9
commit 540b072e6f
No known key found for this signature in database
40 changed files with 1766 additions and 0 deletions

19
LICENSE.md Normal file
View file

@ -0,0 +1,19 @@
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.

229
README.md Normal file
View file

@ -0,0 +1,229 @@
# 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 want to write Typescript, you need `npm`
- If 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`
#### 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://github.com/folke/lazy.nvim#-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>

6
after/ftplugin/c.lua Normal file
View file

@ -0,0 +1,6 @@
vim.opt_local.expandtab = true
vim.opt_local.smartindent = true
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.formatoptions:append { c = true, r = true, o = true, q = true }
vim.bo.commentstring = '// %s'

4
after/ftplugin/cmake.lua Normal file
View file

@ -0,0 +1,4 @@
vim.opt_local.expandtab = true
vim.opt_local.smartindent = true
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2

6
after/ftplugin/cpp.lua Normal file
View file

@ -0,0 +1,6 @@
vim.opt_local.expandtab = true
vim.opt_local.smartindent = true
vim.opt_local.tabstop = 2
vim.opt_local.shiftwidth = 2
vim.opt_local.formatoptions:append { c = true, r = true, o = true, q = true }
vim.bo.commentstring = '// %s'

24
doc/kickstart.txt Normal file
View file

@ -0,0 +1,24 @@
================================================================================
INTRODUCTION *kickstart.nvim*
Kickstart.nvim is a project to help you get started on your neovim journey.
*kickstart-is-not*
It is not:
- Complete framework for every plugin under the sun
- Place to add every plugin that could ever be useful
*kickstart-is*
It is:
- Somewhere that has a good start for the most common "IDE" type features:
- autocompletion
- goto-definition
- find references
- fuzzy finding
- and hinting at what more can be done :)
- A place to _kickstart_ your journey.
- You should fork this project and use/modify it so that it matches your
style and preferences. If you don't want to do that, there are probably
other projects that would fit much better for you (and that's great!)!
vim:tw=78:ts=8:ft=help:norl:

3
doc/tags Normal file
View file

@ -0,0 +1,3 @@
kickstart-is kickstart.txt /*kickstart-is*
kickstart-is-not kickstart.txt /*kickstart-is-not*
kickstart.nvim kickstart.txt /*kickstart.nvim*

52
lua/kickstart/health.lua Normal file
View file

@ -0,0 +1,52 @@
--[[
--
-- This file is not required for your own configuration,
-- but helps people determine if their system is setup correctly.
--
--]]
local check_version = function()
local verstr = tostring(vim.version())
if not vim.version.ge then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end
if vim.version.ge(vim.version(), '0.10-dev') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
end
local check_external_reqs = function()
-- Basic utils: `git`, `make`, `unzip`
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
local is_executable = vim.fn.executable(exe) == 1
if is_executable then
vim.health.ok(string.format("Found executable: '%s'", exe))
else
vim.health.warn(string.format("Could not find executable: '%s'", exe))
end
end
return true
end
return {
check = function()
vim.health.start 'kickstart.nvim'
vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
Fix only warnings for plugins and languages you intend to use.
Mason will give warnings for languages that are not installed.
You do not need to install, unless you want to use those languages!]]
local uv = vim.uv or vim.loop
vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
check_version()
check_external_reqs()
end,
}

View file

@ -0,0 +1,105 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Required dependency for nvim-dap-ui
'nvim-neotest/nvim-nio',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
'leoluz/nvim-dap-go',
},
keys = function(_, keys)
local dap = require 'dap'
local dapui = require 'dapui'
return {
-- Basic debugging keymaps, feel free to change to your liking!
{ '<F5>', dap.continue, desc = 'Debug: Start/Continue' },
{ '<F1>', dap.step_into, desc = 'Debug: Step Into' },
{ '<F2>', dap.step_over, desc = 'Debug: Step Over' },
{ '<F3>', dap.step_out, desc = 'Debug: Step Out' },
{ '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' },
{
'<leader>B',
function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end,
desc = 'Debug: Set Breakpoint',
},
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
{ '<F7>', dapui.toggle, desc = 'Debug: See last session result.' },
unpack(keys),
}
end,
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
},
}
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = '',
},
},
}
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
},
}
end,
}

View file

@ -0,0 +1,55 @@
return {
{ -- Linting
'mfussenegger/nvim-lint',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local lint = require 'lint'
lint.linters_by_ft = {
markdown = { 'markdownlint' },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- clojure = { "clj-kondo" },
-- dockerfile = { "hadolint" },
-- inko = { "inko" },
-- janet = { "janet" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- rst = { "vale" },
-- ruby = { "ruby" },
-- terraform = { "tflint" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['clojure'] = nil
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['inko'] = nil
-- lint.linters_by_ft['janet'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['markdown'] = nil
-- lint.linters_by_ft['rst'] = nil
-- lint.linters_by_ft['ruby'] = nil
-- lint.linters_by_ft['terraform'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
lint.try_lint()
end,
})
end,
},
}

View file

@ -0,0 +1,8 @@
vim.keymap.set('n', '<C-[>', '<cmd>nohlsearch<CR>')
vim.keymap.set('t', '<C-[><C-[>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
vim.keymap.set('n', '<leader>fs', '<cmd>w<cr><Esc>', { desc = 'Save file' })
vim.keymap.set('n', '<leader>ws', '<cmd>split<cr>', { desc = '[W]indow Horizontal [S]plit' }) -- split horizontal
vim.keymap.set('n', '<leader>wv', '<cmd>vsplit<cr>', { desc = '[W]indow [V]ertical Split' }) -- split vertical
vim.keymap.set('n', '<leader>wq', '<C-w>q', { desc = '[W]indow [Q]uit' }) -- quit
vim.keymap.set('n', '<leader>x', '<cmd>!chmod +x %<CR>', { desc = 'Chmod File E[x]ecutable', silent = true })
vim.keymap.set('n', '<leader>lz', '<cmd>Lazy<CR>', { desc = 'Chmod File E[x]ecutable', silent = true })

View file

@ -0,0 +1,14 @@
return {
{
'stevearc/aerial.nvim',
event = 'VeryLazy',
keys = {
{ '<leader>ta', '<cmd>AerialToggle<cr>', desc = '[T]oggle [A]erial' },
},
opts = {},
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-tree/nvim-web-devicons',
},
},
}

View file

@ -0,0 +1,138 @@
return {
-- {
-- 'huynle/ogpt.nvim',
-- event = 'VeryLazy',
-- opts = {
-- default_provider = 'ollama',
-- edgy = true, -- enable this!
-- single_window = false, -- set this to true if you want only one OGPT window to appear at a time
-- providers = {
-- ollama = {
-- api_host = os.getenv 'OLLAMA_API_HOST' or 'http://localhost:11434',
-- api_key = os.getenv 'OLLAMA_API_KEY' or '',
-- },
-- },
-- },
-- dependencies = {
-- 'MunifTanjim/nui.nvim',
-- 'nvim-lua/plenary.nvim',
-- 'nvim-telescope/telescope.nvim',
-- },
-- },
-- {
-- 'folke/edgy.nvim',
-- event = 'VeryLazy',
-- init = function()
-- vim.opt.laststatus = 3
-- vim.opt.splitkeep = 'screen' -- or "topline" or "screen"
-- end,
-- opts = {
-- exit_when_last = false,
-- animate = {
-- enabled = false,
-- },
-- wo = {
-- winbar = true,
-- winfixwidth = true,
-- winfixheight = false,
-- winhighlight = 'WinBar:EdgyWinBar,Normal:EdgyNormal',
-- spell = false,
-- signcolumn = 'no',
-- },
-- keys = {
-- -- -- close window
-- ['q'] = function(win)
-- win:close()
-- end,
-- -- close sidebar
-- ['Q'] = function(win)
-- win.view.edgebar:close()
-- end,
-- -- increase width
-- ['<S-Right>'] = function(win)
-- win:resize('width', 3)
-- end,
-- -- decrease width
-- ['<S-Left>'] = function(win)
-- win:resize('width', -3)
-- end,
-- -- increase height
-- ['<S-Up>'] = function(win)
-- win:resize('height', 3)
-- end,
-- -- decrease height
-- ['<S-Down>'] = function(win)
-- win:resize('height', -3)
-- end,
-- },
-- right = {
-- {
-- title = 'OGPT Popup',
-- ft = 'ogpt-popup',
-- size = { width = 0.2 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPT Parameters',
-- ft = 'ogpt-parameters-window',
-- size = { height = 6 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPT Template',
-- ft = 'ogpt-template',
-- size = { height = 6 },
-- },
-- {
-- title = 'OGPT Sessions',
-- ft = 'ogpt-sessions',
-- size = { height = 6 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPT System Input',
-- ft = 'ogpt-system-window',
-- size = { height = 6 },
-- },
-- {
-- title = 'OGPT',
-- ft = 'ogpt-window',
-- size = { height = 0.5 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPT {{{selection}}}',
-- ft = 'ogpt-selection',
-- size = { width = 80, height = 4 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPt {{{instruction}}}',
-- ft = 'ogpt-instruction',
-- size = { width = 80, height = 4 },
-- wo = {
-- wrap = true,
-- },
-- },
-- {
-- title = 'OGPT Chat',
-- ft = 'ogpt-input',
-- size = { width = 80, height = 4 },
-- wo = {
-- wrap = true,
-- },
-- },
-- },
-- },
-- },
}

View file

@ -0,0 +1,216 @@
local utils = require 'rayandrew.utils'
return {
{ -- Autocompletion
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
{
'zbirenbaum/copilot-cmp',
-- enable if hostname starts with polaris-*
cond = utils.is_argonne_servers(),
opts = {},
dependencies = {
{
'zbirenbaum/copilot.lua',
cmd = 'Copilot',
event = 'InsertEnter',
config = true,
},
},
config = function(_, opts)
local copilot_cmp = require 'copilot_cmp'
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
local on_attach = function(client, _)
if client.name == 'copilot' then
copilot_cmp._on_insert_enter {}
end
end
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
local buffer = args.buf ---@type number
local client = vim.lsp.get_client_by_id(args.data.client_id)
on_attach(client, buffer)
end,
})
end,
},
{
'sourcegraph/sg.nvim',
dependencies = { 'nvim-lua/plenary.nvim' },
cond = not utils.is_argonne_servers(),
opts = {
enable_cody = true,
accept_tos = true,
download_binaries = true,
},
},
-- {
-- 'Exafunction/codeium.nvim',
-- dependencies = { 'nvim-lua/plenary.nvim' },
-- config = true,
-- -- disable if hostname starts with polaris-*
-- cond = not utils.is_argonne_servers(),
-- },
-- {
-- 'tzachar/cmp-ai',
-- config = function()
-- local cmp_ai = require 'cmp_ai.config'
--
-- cmp_ai:setup {
-- max_lines = 100,
-- provider = 'Ollama',
-- provider_options = {
-- model = 'codegemma:2b-code',
-- prompt = function(lines_before, lines_after)
-- return lines_before
-- end,
-- suffix = function(lines_after)
-- return lines_after
-- end,
-- },
-- notify = true,
-- -- notify_callback = function(msg)
-- -- vim.notify(msg)
-- -- end,
-- run_on_every_keystroke = true,
-- ignored_file_types = {
-- -- default is not to ignore
-- -- uncomment to ignore in lua:
-- -- lua = true
-- },
-- }
-- end,
-- },
},
config = function()
-- See `:help cmp`
local cmp = require 'cmp'
local luasnip = require 'luasnip'
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = 'menu,menuone,noinsert' },
-- For an understanding of why these mappings were
-- chosen, you will need to read `:help ins-completion`
--
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete {},
-- ['<C-x>'] = cmp.mapping(
-- cmp.mapping.complete {
-- config = {
-- sources = cmp.config.sources {
-- -- { name = 'cmp_ai' },
-- -- { name = 'codeium' },
-- { name = 'cody' },
-- },
-- },
-- },
-- { 'i' }
-- ),
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
-- { name = 'cmp_ai' },
{ name = 'cody' },
{ name = 'codeium' },
{ name = 'copilot' },
{
name = 'lazydev',
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
group_index = 0,
},
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
},
}
end,
},
}

View file

@ -0,0 +1,16 @@
-- autopairs
-- https://github.com/windwp/nvim-autopairs
return {
'windwp/nvim-autopairs',
event = 'InsertEnter',
-- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' },
config = function()
require('nvim-autopairs').setup {}
-- If you want to automatically add `(` after selecting a function or method
local cmp_autopairs = require 'nvim-autopairs.completion.cmp'
local cmp = require 'cmp'
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done())
end,
}

View file

@ -0,0 +1,46 @@
return {
{
'thimc/gruber-darker.nvim',
lazy = true,
-- priority = 1000,
opts = {
transparent = true,
},
config = function(_, opts)
require('gruber-darker').setup(opts)
vim.cmd.colorscheme 'gruber-darker'
vim.cmd.hi 'Comment gui=none'
end,
},
{
'Mofiqul/adwaita.nvim',
lazy = true,
-- priority = 1000,
-- configure and set on startup
config = function()
vim.g.adwaita_darker = true -- for darker version
vim.g.adwaita_disable_cursorline = true -- to disable cursorline
vim.g.adwaita_transparent = true -- makes the background transparent
-- vim.cmd.colorscheme 'adwaita'
end,
},
{
'HoNamDuong/hybrid.nvim',
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme 'hybrid'
end,
},
{
'rebelot/kanagawa.nvim',
lazy = true,
-- priority = 1000,
config = function()
-- vim.cmd.colorscheme 'kanagawa-dragon'
end,
},
}

View file

@ -0,0 +1,15 @@
return {
'ej-shafran/compile-mode.nvim',
branch = 'latest',
cmd = { 'Compile' },
-- or a specific version:
-- tag = "v3.0.0"
dependencies = {
'nvim-lua/plenary.nvim',
{ 'm00qek/baleia.nvim', tag = 'v1.3.0' },
},
opts = {
-- to add ANSI escape code support, add:
baleia_setup = true,
},
}

View file

@ -0,0 +1,47 @@
return {
{ -- Autoformat
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 5000,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
python = { 'isort', 'black' },
rust = { 'rustfmt' },
nix = { 'alejandra' },
c = { 'clang-format' },
cpp = { 'clang-format' },
['_'] = { 'trim_whitespace', 'trim_newlines', 'squeeze_blanks' },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
},
}

View file

@ -0,0 +1,56 @@
return {
{
'kevinhwang91/nvim-ufo',
dependencies = {
{ 'kevinhwang91/promise-async' },
},
init = function()
vim.o.foldcolumn = '0' -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
end,
config = function()
local handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local totalLines = vim.api.nvim_buf_line_count(0)
local foldedLines = endLnum - lnum
local suffix = (' ↙ %d %d%%'):format(foldedLines, foldedLines / totalLines * 100)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
local rAlignAppndx = math.max(width - 3 - curWidth - sufWidth, 0)
suffix = (' '):rep(rAlignAppndx) .. suffix
table.insert(newVirtText, { suffix, 'MoreMsg' })
return newVirtText
end
require('ufo').setup {
provider_selector = function()
return { 'treesitter', 'indent' }
end,
fold_virt_text_handler = handler,
}
-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
end,
},
}

View file

@ -0,0 +1,38 @@
return {
{
'ibhagwan/fzf-lua',
event = 'VimEnter',
-- dependencies = { 'nvim-tree/nvim-web-devicons' },
dependencies = { 'echasnovski/mini.icons' },
-- build = './install --bin',
config = function()
local fzf = require 'fzf-lua'
fzf.setup {
{
'default',
keymap = {
builtin = {
true, -- inherit all other default binds
['<Esc>'] = 'close',
['<C-[>'] = 'close',
},
},
},
}
vim.keymap.set('n', '<leader>sf', fzf.files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sk', fzf.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>ss', fzf.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sg', fzf.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', fzf.diagnostics_document, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', fzf.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', fzf.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', fzf.buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>sh', fzf.helptags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', fzf.grep_cword, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>/', fzf.lgrep_curbuf, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>sn', function()
fzf.files { cwd = vim.fn.stdpath 'config' }
end, { desc = '[S]earch [N]eovim files' })
end,
},
}

View file

@ -0,0 +1,16 @@
return {
{
'akinsho/git-conflict.nvim',
event = 'VeryLazy',
version = '*',
config = function()
require('git-conflict').setup()
vim.api.nvim_create_autocmd('User', {
pattern = 'GitConflictDetected',
callback = function()
vim.notify('Conflict detected in ' .. vim.fn.expand '<afile>')
end,
})
end,
},
}

View file

@ -0,0 +1,71 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
-- NOTE: gitsigns is already included in init.lua but contains only the base
-- config. This will add also the recommended keymaps.
-- See `:help gitsigns` to understand what the configuration keys do
return {
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then
vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end
end, { desc = 'Jump to next git [c]hange' })
map('n', '[c', function()
if vim.wo.diff then
vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end
end, { desc = 'Jump to previous git [c]hange' })
-- Actions
-- visual mode
map('v', '<leader>hs', function()
gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' })
map('v', '<leader>hr', function()
gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' })
-- normal mode
map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function()
gitsigns.diffthis '@'
end, { desc = 'git [D]iff against last commit' })
-- Toggles
map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
end,
},
},
}

View file

@ -0,0 +1,60 @@
return {
{
'theprimeagen/harpoon',
event = 'VeryLazy',
keys = {
{
'<leader>ha',
function()
local mark = require 'harpoon.mark'
mark.add_file()
vim.print('Added to Harpoon ' .. vim.fn.expand '%')
end,
desc = 'Harpoon Add File',
},
{
'<leader>he',
function()
local ui = require 'harpoon.ui'
ui.toggle_quick_menu()
end,
desc = 'Harpoon UI',
},
{
'<leader>h1',
function()
local ui = require 'harpoon.ui'
ui.nav_file(1)
end,
},
{
'<leader>h2',
function()
local ui = require 'harpoon.ui'
ui.nav_file(2)
end,
},
{
'<leader>h3',
function()
local ui = require 'harpoon.ui'
ui.nav_file(3)
end,
},
{
'<leader>h4',
function()
local ui = require 'harpoon.ui'
ui.nav_file(4)
end,
},
{
'<leader>h5',
function()
local ui = require 'harpoon.ui'
ui.nav_file(5)
end,
},
},
},
}

View file

@ -0,0 +1,9 @@
return {
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help ibl`
main = 'ibl',
opts = {},
},
}

View file

@ -0,0 +1,11 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
vim.schedule(function()
require 'rayandrew.keymaps'
require 'rayandrew.commands'
end)
--
-- See the kickstart.nvim README for more information
return {}

View file

@ -0,0 +1,11 @@
return {
{
'OXY2DEV/markview.nvim',
lazy = true,
ft = 'markdown',
dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-tree/nvim-web-devicons',
},
},
}

View file

@ -0,0 +1,81 @@
return {
{ -- buffer remove
'echasnovski/mini.bufremove',
version = false,
-- stylua: ignore
keys = {
{ "<leader>bd", function() require("mini.bufremove").delete(0, false) end, desc = "Delete Buffer" },
{ "<leader>bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" },
},
},
{
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [Q]uote
-- - ci' - [C]hange [I]nside [']quote
'echasnovski/mini.ai',
version = false,
opts = {
n_lines = 500,
},
},
{
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
'echasnovski/mini.surround',
version = false,
config = true,
},
{
'echasnovski/mini.statusline',
version = false,
config = function()
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
local statusline = require 'mini.statusline'
-- set use_icons to true if you have a Nerd Font
statusline.setup { use_icons = vim.g.have_nerd_font }
-- You can configure sections in the statusline by overriding their
-- default behavior. For example, here we set the section for
-- cursor location to LINE:COLUMN
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return '%2l:%-2v'
end
end,
},
{
'echasnovski/mini.indentscope',
version = false,
config = true,
},
{
'echasnovski/mini-git',
main = 'mini.git',
version = false,
config = true,
keys = {
{ '<leader>gs', '<cmd>lua MiniGit.show_at_cursor()<cr>', mode = 'n' },
{ '<leader>gs', '<cmd>lua MiniGit.show_at_cursor()<cr>', mode = 'x' },
},
},
-- {
-- 'echasnovski/mini.comment',
-- version = false,
-- config = true,
-- keys = {
-- 'gc',
-- 'gcc',
-- },
-- },
}

View file

@ -0,0 +1,42 @@
return {
-- lazy.nvim:
{
'smoka7/multicursors.nvim',
event = 'VeryLazy',
dependencies = {
'nvimtools/hydra.nvim',
},
opts = {
normal_keys = {
-- to change default lhs of key mapping change the key
['<C-[>'] = {
method = nil,
opts = { desc = 'Exit' },
},
},
insert_keys = {
-- to change default lhs of key mapping change the key
['<C-[>'] = {
method = nil,
opts = { desc = 'Exit' },
},
},
extend_keys = {
-- to change default lhs of key mapping change the key
['<C-[>'] = {
method = nil,
opts = { desc = 'Exit' },
},
},
},
cmd = { 'MCstart', 'MCvisual', 'MCclear', 'MCpattern', 'MCvisualPattern', 'MCunderCursor' },
keys = {
{
mode = { 'v', 'n' },
'<Leader>m',
'<cmd>MCstart<cr>',
desc = 'Create a selection for selected text or word under the cursor',
},
},
},
}

View file

@ -0,0 +1,73 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
-- {
-- '<leader>fe',
-- ':Neotree toggle<CR>',
-- desc = 'Toggle NeoTree',
-- },
},
opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
['<space>'] = 'none',
-- ["C"] = "copy",
['C'] = {
'copy',
config = {
show_path = 'absolute', -- "none", "relative", "absolute"
},
},
['R'] = { 'rename', config = { show_path = 'absolute' } },
['y'] = function(state)
local node = state.tree:get_node()
-- get relative path
local filepath = node:get_id()
local filename = vim.fn.fnamemodify(filepath, ':.')
-- local filename = node.name
vim.fn.setreg('+', filename)
vim.notify('Copied: ' .. filename)
end,
['Y'] = function(state)
local node = state.tree:get_node()
local filepath = node:get_id()
vim.fn.setreg('+', filepath)
vim.notify('Copied: ' .. filepath)
end,
['O'] = {
command = function(state)
local node = state.tree:get_node()
local filepath = node.path
local osType = os.getenv 'OS'
local command
if osType == 'Windows_NT' then
command = 'start ' .. filepath
elseif osType == 'Darwin' then
command = 'open ' .. filepath
else
command = 'xdg-open ' .. filepath
end
os.execute(command)
end,
desc = 'open_with_system_defaults',
},
},
},
},
},
}

View file

@ -0,0 +1,22 @@
return {
{
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim', -- required
'sindrets/diffview.nvim', -- optional - Diff integration
-- Only one of these is needed, not both.
'nvim-telescope/telescope.nvim', -- optional
'ibhagwan/fzf-lua', -- optional
},
config = true,
lazy = true,
keys = {
{
'<leader>gg',
':Neogit<CR>',
desc = 'Neo[g]it',
},
},
},
}

View file

@ -0,0 +1,7 @@
return {
{
'nacro90/numb.nvim',
event = 'VimEnter',
config = true,
},
}

View file

@ -0,0 +1,72 @@
return {
{
'stevearc/oil.nvim',
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
cmd = { 'Oil' },
opts = {
default_file_explorer = true,
restore_win_options = true,
use_default_keymaps = false,
float = {
padding = 2,
max_width = 240,
max_height = 70,
-- width = 0.2,
-- max_height = 0.5,
border = 'rounded',
win_options = {
winblend = 10,
},
},
keymaps = {
['g?'] = 'actions.show_help',
['<CR>'] = 'actions.select',
-- ['<C-s>'] = { 'actions.select', opts = { vertical = true }, desc = 'Open the entry in a vertical split' },
-- ['<C-h>'] = { 'actions.select', opts = { horizontal = true }, desc = 'Open the entry in a horizontal split' },
['<C-t>'] = { 'actions.select', opts = { tab = true }, desc = 'Open the entry in new tab' },
['<C-p>'] = 'actions.preview',
['<C-c>'] = 'actions.close',
['<C-[>'] = 'actions.close',
['<C-r>'] = 'actions.refresh',
['-'] = 'actions.parent',
['_'] = 'actions.open_cwd',
['`'] = 'actions.cd',
['~'] = { 'actions.cd', opts = { scope = 'tab' }, desc = ':tcd to the current oil directory' },
['gs'] = 'actions.change_sort',
['gx'] = 'actions.open_external',
['g.'] = 'actions.toggle_hidden',
['g\\'] = 'actions.toggle_trash',
['<C-i>'] = {
callback = function()
if vim.bo.filetype == 'oil' then
local oil = require 'oil'
vim.g.oil_show_info = not vim.g.oil_show_info
if vim.g.oil_show_info then
oil.set_columns {
'permissions',
'size',
'mtime',
'icon',
}
else
oil.set_columns {}
end
return
end
end,
desc = 'Toggle info',
},
['q'] = 'actions.close',
-- ['<C-h>'] = 'actions.toggle_hidden',
['?'] = 'actions.show_help',
},
},
keys = {
{ '<leader>fm', '<cmd>Oil<cr>', desc = '[F]ile [M]anager' },
{ '<leader>fM', '<cmd>Oil --float<cr>', desc = '[F]ile [M]anager' },
},
init = function()
vim.g.oil_show_info = false
end,
},
}

View file

@ -0,0 +1,15 @@
return {
{
'ojroques/nvim-osc52',
event = 'VimEnter',
config = function()
local copy = function()
if vim.v.event.operator == 'y' and vim.v.event.regname == '+' then
require('osc52').copy_register '+'
end
end
vim.api.nvim_create_autocmd('TextYankPost', { callback = copy })
end,
},
}

View file

@ -0,0 +1,14 @@
return {
{
'hedyhli/outline.nvim',
event = 'VeryLazy',
keys = {
{ '<leader>to', '<cmd>Outline<cr>', desc = '[T]oggle [O]utline' },
},
config = function()
require('outline').setup {
-- Your setup opts here (leave empty to use defaults)
}
end,
},
}

View file

@ -0,0 +1,34 @@
return {
{
'HiPhish/rainbow-delimiters.nvim',
event = 'VimEnter',
config = function()
local rainbow_delimiters = require 'rainbow-delimiters'
---@type rainbow_delimiters.config
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow_delimiters.strategy['global'],
vim = rainbow_delimiters.strategy['local'],
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
},
priority = {
[''] = 110,
lua = 210,
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
},
}
end,
},
}

View file

@ -0,0 +1,78 @@
return {
{
'assistcontrol/readline.nvim',
event = 'VeryLazy',
keys = {
{
'<M-f>',
function()
require('readline').forward_word()
end,
mode = '!',
},
{
'<M-b>',
function()
require('readline').backward_word()
end,
mode = '!',
},
{
'<M-d>',
function()
require('readline').kill_word()
end,
mode = '!',
},
{
'<M-BS>',
function()
require('readline').backward_kill_word()
end,
mode = '!',
},
{
'<C-w>',
function()
require('readline').unix_word_rubout()
end,
mode = '!',
},
{
'<C-k>',
function()
require('readline').kill_line()
end,
mode = '!',
},
{
'<C-u>',
function()
require('readline').backward_kill_line()
end,
mode = '!',
},
{
'<C-a>',
function()
require('readline').beginning_of_line()
end,
mode = '!',
},
{
'<C-e>',
function()
require('readline').end_of_line()
end,
mode = '!',
},
{ '<C-f>', '<Right>', mode = '!' }, -- forward-char
{ '<C-b>', '<Left>', mode = '!' }, -- backward-char
{ '<C-n>', '<Down>', mode = '!' }, -- next-line
{ '<C-p>', '<Up>', mode = '!' }, -- previous-line
{ '<C-d>', '<Delete>', mode = '!' }, -- delete-char
{ '<C-h>', '<BS>', mode = '!' }, -- backward-delete-char
{ '<C-g>', '<Esc>', mode = '!' }, -- abort
},
},
}

View file

@ -0,0 +1,15 @@
return {
{
'christoomey/vim-tmux-navigator',
cmd = {
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
},
keys = { '<C-h>', '<C-j>', '<C-k>', '<C-l>' },
config = function()
vim.g.tmux_navigator_no_wrap = 1
end,
},
}

View file

@ -0,0 +1,18 @@
return {
{
'joshuadanpeterson/typewriter',
dependencies = {
'nvim-treesitter/nvim-treesitter',
},
lazy = true,
config = true,
cmd = { 'TWEnable', 'TWToggle' },
opts = {
enable_with_zen_mode = true,
enable_with_true_zen = true,
-- keep_cursor_position = true,
enable_notifications = true,
-- enable_horizontal_scroll = true,
},
},
}

View file

@ -0,0 +1,9 @@
return {
{
'mbbill/undotree',
cmd = { 'UndotreeToggle' },
keys = {
{ '<leader>ut', '<cmd>UndotreeToggle<cr>', desc = '[U]ndo Tree' },
},
},
}

11
lua/rayandrew/utils.lua Normal file
View file

@ -0,0 +1,11 @@
local M = {}
local _is_argonne_servers = false
M.is_argonne_servers = function()
local is_polaris = not not (vim.fn.hostname():match '^polaris%-')
_is_argonne_servers = is_polaris
return _is_argonne_servers
end
return M