initial commit
This commit is contained in:
7
.luarc.json
Normal file
7
.luarc.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"workspace.library": [
|
||||
"/opt/homebrew/Cellar/neovim/0.12.0/share/nvim/runtime/lua",
|
||||
"~/.local/share/nvim/lazy/lazy.nvim/lua"
|
||||
]
|
||||
}
|
||||
113
init.lua
Normal file
113
init.lua
Normal file
@@ -0,0 +1,113 @@
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ','
|
||||
|
||||
vim.o.number = true
|
||||
|
||||
vim.o.mouse = 'a'
|
||||
vim.o.showmode = false
|
||||
|
||||
vim.schedule(function() vim.o.clipboard = 'unnamedplus' end)
|
||||
|
||||
vim.o.breakindent = true
|
||||
|
||||
vim.o.undofile = true
|
||||
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Adds extra space for git diff symbols and stuff
|
||||
vim.o.signcolumn = 'yes'
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
|
||||
-- Decrease mapped sequence wait time
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
-- Configure how new splits should be opened
|
||||
vim.o.splitright = true
|
||||
vim.o.splitbelow = true
|
||||
vim.o.list = true
|
||||
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.o.inccommand = 'split'
|
||||
|
||||
-- Show which line your cursor is on
|
||||
vim.o.cursorline = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.o.scrolloff = 3
|
||||
|
||||
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||
-- See `:help 'confirm'`
|
||||
vim.o.confirm = true
|
||||
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function() vim.hl.on_yank() end,
|
||||
})
|
||||
|
||||
-- Clear highlights on search when pressing <Esc> in normal mode
|
||||
-- See `:help hlsearch`
|
||||
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
||||
|
||||
-- Diagnostic Config & Keymaps
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config {
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = { min = vim.diagnostic.severity.WARN } },
|
||||
|
||||
-- Can switch between these as you prefer
|
||||
virtual_text = false, -- Text shows up at the end of the line
|
||||
virtual_lines = true, -- Text shows up underneath the line, with virtual lines
|
||||
|
||||
-- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d`
|
||||
jump = { float = true },
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||
|
||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
vim.keymap.set('n', 'K', function() vim.lsp.buf.hover({border = 'rounded'}) end)
|
||||
|
||||
vim.lsp.enable({'lua_ls'})
|
||||
|
||||
local github = 'https://github.com/'
|
||||
vim.pack.add({
|
||||
github .. 'nvim-lua/plenary.nvim',
|
||||
github .. 'nvim-telescope/telescope-fzf-native.nvim',
|
||||
github .. 'nvim-telescope/telescope.nvim',
|
||||
github .. 'stevearc/oil.nvim',
|
||||
github .. 'neovim/nvim-lspconfig',
|
||||
github .. 'nvim-mini/mini.nvim',
|
||||
github .. 'lewis6991/gitsigns.nvim',
|
||||
github .. 'neogitorg/neogit',
|
||||
})
|
||||
|
||||
-- Telescope
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
|
||||
|
||||
-- Oil
|
||||
require('oil').setup({
|
||||
default_file_explorer = true,
|
||||
columns = {
|
||||
"icon",
|
||||
}
|
||||
})
|
||||
vim.keymap.set('n', '<leader>rw', '<CMD>Oil<CR>', { desc = 'Open file explorer' })
|
||||
|
||||
-- Mini
|
||||
require('mini.move').setup()
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- Neogit
|
||||
vim.keymap.set('n', '<leader>gg', '<CMD>Neogit<CR>')
|
||||
36
nvim-pack-lock.json
Normal file
36
nvim-pack-lock.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"plugins": {
|
||||
"gitsigns.nvim": {
|
||||
"rev": "50c205548d8b037b7ff6378fca6d21146f0b6161",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
"mini.nvim": {
|
||||
"rev": "af5f75c9ce572a4d1f0c77d6fb4ea764d16c1b3c",
|
||||
"src": "https://github.com/nvim-mini/mini.nvim"
|
||||
},
|
||||
"neogit": {
|
||||
"rev": "4681c1fdac1b730592ae195576e87406f7255750",
|
||||
"src": "https://github.com/neogitorg/neogit"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "16812abf0e8d8175155f26143a8504e8253e92b0",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
"rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509",
|
||||
"src": "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
"telescope-fzf-native.nvim": {
|
||||
"rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c",
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "5255aa27c422de944791318024167ad5d40aad20",
|
||||
"src": "https://github.com/nvim-telescope/telescope.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user