neovim config, install jj
This commit is contained in:
parent
2ccc700629
commit
24e74cde32
12 changed files with 239 additions and 2 deletions
|
@ -1,4 +1,10 @@
|
|||
[tools]
|
||||
usage = "latest"
|
||||
erlang = "26.2.2"
|
||||
elixir = "1.16"
|
||||
erlang = "27.0"
|
||||
elixir = "1.17.1-otp-27"
|
||||
rust = "latest"
|
||||
"cargo:cargo-binstall" = "latest"
|
||||
"cargo:jj-cli" = "latest"
|
||||
|
||||
[settings]
|
||||
experimental = true
|
||||
|
|
3
.config/nvim/init.lua
Normal file
3
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require("config.base")
|
||||
require("config.lazy")
|
||||
require("config.mappings")
|
21
.config/nvim/lazy-lock.json
Normal file
21
.config/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"lazy.nvim": { "branch": "main", "commit": "c92c6b5fd2b3a13c8999ab8379e43a79c9406e59" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.icons": { "branch": "main", "commit": "c291191e2a2a99f8aeea5e4d6406af54d11c9608" },
|
||||
"nerdtree": { "branch": "master", "commit": "fbb71fcd90602e3ec77f40b864b5f9b437c496c5" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "df9c116cbcf0aa7e58f2b36b0296fa687e87f36f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "874b99065b4b00b84b0ca5fa63490c93728a45ab" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" },
|
||||
"vim-commentary": { "branch": "master", "commit": "c4b8f52cbb7142ec239494e5a2c4a512f92c4d07" },
|
||||
"vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" },
|
||||
"vim-helix": { "branch": "main", "commit": "0d6bab9626cf74dedc16997e9f8d8c356939e76d" },
|
||||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" },
|
||||
"vim-sensible": { "branch": "master", "commit": "0ce2d843d6f588bb0c8c7eec6449171615dc56d9" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "72aba5565ea1a03b1d4df5ede793dae29d874ea0" }
|
||||
}
|
6
.config/nvim/lua/config/base.lua
Normal file
6
.config/nvim/lua/config/base.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
32
.config/nvim/lua/config/lazy.lua
Normal file
32
.config/nvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
-- 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 = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
93
.config/nvim/lua/config/mappings.lua
Normal file
93
.config/nvim/lua/config/mappings.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
local wk = require('which-key')
|
||||
local map = vim.keymap.set
|
||||
|
||||
wk.setup({
|
||||
replace = {
|
||||
key = {
|
||||
{ '<space>', 'SPC' },
|
||||
{ '<cr>', 'RET' },
|
||||
{ '<tab>', 'TAB' },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.opt.timeoutlen = 500
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Handy to remap semi-colon to colon
|
||||
map({ 'n', 'v' }, ';', ':')
|
||||
map({ 'n', 'v' }, 'q;', 'q:')
|
||||
|
||||
-- System clipboard via <leader> -> y | p
|
||||
map({ 'n', 'v' }, '<leader>y', '"+y')
|
||||
map( 'n', 'Y', '"+Y')
|
||||
map({ 'n', 'v' }, '<leader>p', '"+p')
|
||||
map({ 'n', 'v' }, '<leader>P', '"+P')
|
||||
|
||||
-- Common short-hands
|
||||
map('n', '<leader>w', '<cmd>w<cr>')
|
||||
map('n', '<leader>q', '<cmd>q<cr>')
|
||||
map('n', '<leader>o', '<cmd>only<cr>')
|
||||
map('n', '<esc>', '<cmd>nohlsearch<cr>')
|
||||
|
||||
wk.add({
|
||||
{ '<leader><tab>', '<cmd>NERDTreeToggle<cr>', desc = 'Toggle NERDTree' },
|
||||
{ '<leader><space>', '<cmd>Telescope find_files theme=dropdown<cr>', desc = 'Find file in current directory' },
|
||||
{ '<leader>/', '<cmd>Telescope live_grep<cr>', desc = 'Search current directory' },
|
||||
|
||||
|
||||
-- File
|
||||
{ '<leader>fl', '<cmd>NERDTreeFind<cr>', desc = 'Show in NERDTree' },
|
||||
|
||||
})
|
||||
|
||||
-- wk.register({
|
||||
-- ['<space>'] = { '<cmd>Telescope find_files theme=dropdown<cr>', 'File file in project' },
|
||||
-- ['/'] = { '<cmd>Telescope live_grep<cr>', 'Search project' },
|
||||
-- ['<tab>'] = { '<cmd>NERDTreeToggle<cr>', 'Toggle NERDTree' },
|
||||
|
||||
-- f = {
|
||||
-- name = 'file',
|
||||
-- e = { '<cmd>Telescope find_files cwd=~/.config/nvim<cr>', 'Find file in .config/nvim' },
|
||||
-- E = { '<cmd>e ~/.config/nvim<cr>', 'Browse .config/nvim' },
|
||||
-- f = { '<cmd>Telescope find_files cwd=~/ hidden=true no_ignore=true no_ignore_parent=true follow=true theme=dropdown<cr>', 'Find file' },
|
||||
-- F = { '<cmd>Telescope find_files theme=dropdown<cr>', 'File file from here' },
|
||||
-- l = { '<cmd>NERDTreeFind<cr>', 'Locate file' },
|
||||
-- r = { '<cmd>Telescope oldfiles<cr>', 'Recent files' },
|
||||
-- },
|
||||
|
||||
-- e = {
|
||||
-- name = 'editor',
|
||||
-- p = {
|
||||
-- name = 'packer',
|
||||
-- s = { '<cmd>PackerSync<cr>', 'Packer Sync' },
|
||||
-- c = { '<cmd>PackerCompile<cr>', 'Packer Compile' },
|
||||
-- l = { '<cmd>PackerClean<cr>', 'Packer Clean' },
|
||||
-- }
|
||||
-- },
|
||||
|
||||
-- g = {
|
||||
-- name = 'git',
|
||||
-- s = { '<cmd>Git<cr>', 'Status' },
|
||||
-- p = { '<cmd>Git push -u origin head<cr>', 'Push' },
|
||||
-- P = { '<cmd>Git push -u origin head --force-with-lease<cr>', 'Push (force with lease)' },
|
||||
-- f = {
|
||||
-- name = 'fetch',
|
||||
-- o = { '<cmd>Git fetch origin<cr>', 'origin' },
|
||||
-- u = { '<cmd>Git fetch upstream<cr>', 'upstream' },
|
||||
-- },
|
||||
-- r = {
|
||||
-- name = 'rebase',
|
||||
-- o = { '<cmd>Git rebase origin/main<cr>', 'origin/main' },
|
||||
-- O = { '<cmd>Git rebase --interactive origin/main<cr>', '-i origin/main' },
|
||||
-- u = { '<cmd>Git rebase upstream/main<cr>', 'upstream/main' },
|
||||
-- U = { '<cmd>Git rebase --interactive upstream/main<cr>', '-i upstream/main' },
|
||||
-- }
|
||||
-- },
|
||||
|
||||
-- i = {
|
||||
-- name = 'insert',
|
||||
-- e = { '<cmd>Telescope emoji theme=dropdown<cr>', 'emoji' },
|
||||
-- },
|
||||
|
||||
-- }, { prefix = '<leader>' })
|
10
.config/nvim/lua/plugins/colorscheme.lua
Normal file
10
.config/nvim/lua/plugins/colorscheme.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
{
|
||||
'foxoman/vim-helix',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function ()
|
||||
vim.cmd([[colorscheme helix-boo]])
|
||||
end,
|
||||
},
|
||||
}
|
35
.config/nvim/lua/plugins/core.lua
Normal file
35
.config/nvim/lua/plugins/core.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
return {
|
||||
{ 'tpope/vim-sensible' },
|
||||
{ 'tpope/vim-surround' },
|
||||
{ 'tpope/vim-commentary' },
|
||||
{ 'tpope/vim-repeat' },
|
||||
{ 'tpope/vim-dispatch' },
|
||||
{ 'tpope/vim-abolish' },
|
||||
|
||||
{
|
||||
'christoomey/vim-tmux-navigator',
|
||||
cmd = {
|
||||
'TmuxNavigateLeft',
|
||||
'TmuxNavigateDown',
|
||||
'TmuxNavigateUp',
|
||||
'TmuxNavigateRight',
|
||||
'TmuxNavigatePrevious',
|
||||
},
|
||||
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>' },
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'folke/which-key.nvim',
|
||||
lazy = true,
|
||||
dependencies = {
|
||||
'echasnovski/mini.icons',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
},
|
||||
}
|
9
.config/nvim/lua/plugins/lsp.lua
Normal file
9
.config/nvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'neovim/nvim-lspconfig',
|
||||
}
|
||||
},
|
||||
}
|
3
.config/nvim/lua/plugins/treesitter.lua
Normal file
3
.config/nvim/lua/plugins/treesitter.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
{ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
}
|
18
.config/nvim/lua/plugins/ui.lua
Normal file
18
.config/nvim/lua/plugins/ui.lua
Normal file
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
{
|
||||
'preservim/nerdtree',
|
||||
cmd = {
|
||||
'NERDTree',
|
||||
'NERDTreeToggle',
|
||||
'NERDTreeFind',
|
||||
'NERDTreeFocus'
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.8',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
cmd = { 'Telescope' },
|
||||
},
|
||||
}
|
1
.jjconfig.toml
Symbolic link
1
.jjconfig.toml
Symbolic link
|
@ -0,0 +1 @@
|
|||
/nix/store/rpzzkvjfhnqj9qi93xd05glh3vw5d2zs-home-manager-files/.jjconfig.toml
|
Loading…
Reference in a new issue