Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2646541406 | ||
|
|
b512fd2ff3 | ||
|
|
095ee1e73e | ||
|
|
38709a3b71 | ||
|
|
391b30bd7a | ||
|
|
0af71243a3 | ||
|
|
d0ea7c50a0 | ||
|
|
233275c160 | ||
|
|
ccd0319364 | ||
|
|
f11dae4fce | ||
|
|
09e50948e4 | ||
|
|
d1167c2fe9 |
@@ -44,11 +44,31 @@ vim.cmd([[source ~/repos/nvim-kickstart/lua/custom/vimrc]])
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
---------- treesitter.start guard >------------------------------
|
||||
-- Neovim's own bundled ftplugin/<lang>.lua calls vim.treesitter.start()
|
||||
-- unconditionally. When the system's bundled highlight queries are ahead of
|
||||
-- the currently available parser/grammar (a packaging/version skew, not a
|
||||
-- config issue), that call throws and takes down the whole FileType autocmd
|
||||
-- chain for the buffer (breaking omnifunc/foldexpr along with it). Guard it
|
||||
-- here, before any buffer can trigger it, so a mismatch just falls back to
|
||||
-- regex syntax highlighting instead of erroring.
|
||||
do
|
||||
local orig_start = vim.treesitter.start
|
||||
vim.treesitter.start = function(...)
|
||||
local ok, err = pcall(orig_start, ...)
|
||||
if not ok then
|
||||
vim.notify_once('treesitter.start failed, falling back to regex highlighting: ' .. tostring(err),
|
||||
vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end
|
||||
---------- </treesitter.start guard ------------------------------
|
||||
|
||||
-- Install package manager
|
||||
-- https://github.com/folke/lazy.nvim
|
||||
-- `:help lazy.nvim.txt` for more info
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
vim.fn.system {
|
||||
'git',
|
||||
'clone',
|
||||
@@ -77,9 +97,7 @@ require('lazy').setup({
|
||||
|
||||
-- seems i need this regardless
|
||||
'neovim/nvim-lspconfig',
|
||||
{
|
||||
'williamboman/mason.nvim', config = true
|
||||
},
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
{
|
||||
-- Autocompletion
|
||||
@@ -134,7 +152,7 @@ require('lazy').setup({
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
@@ -154,22 +172,26 @@ require('lazy').setup({
|
||||
|
||||
{ -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = "main",
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.config').setup({
|
||||
ensure_installed = { 'bash', 'php', 'rust', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = { 'ruby' },
|
||||
},
|
||||
indent = { enable = true, disable = { 'ruby' } },
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
branch = "main"
|
||||
},
|
||||
init = function()
|
||||
local ensureInstalled = {
|
||||
'lua', 'python', 'typescript',
|
||||
-- ... your parsers
|
||||
}
|
||||
local alreadyInstalled = require('nvim-treesitter.config').get_installed()
|
||||
local parsersToInstall = vim.iter(ensureInstalled)
|
||||
:filter(function(parser)
|
||||
return not vim.tbl_contains(alreadyInstalled, parser)
|
||||
end)
|
||||
:totable()
|
||||
require('nvim-treesitter').install(parsersToInstall)
|
||||
end,
|
||||
},
|
||||
|
||||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
||||
@@ -188,48 +210,8 @@ require('lazy').setup({
|
||||
{ import = 'custom.plugins' },
|
||||
}, {})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = false
|
||||
|
||||
-- Make line numbers default
|
||||
vim.wo.number = true
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'a'
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
-- See `:help 'clipboard'`
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.wo.signcolumn = 'yes'
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
vim.o.timeoutlen = 300
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
|
||||
-- NOTE: You should make sure your terminal supports this
|
||||
vim.o.termguicolors = true
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- See lua/custom/options.lua for vim.opt settings
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
@@ -258,61 +240,13 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
-- See `:help telescope.builtin`
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '[d', function() vim.diagnostic.jump({ count = -1 }) end,
|
||||
{ desc = 'Go to previous diagnostic message' })
|
||||
vim.keymap.set('n', ']d', function() vim.diagnostic.jump({ count = 1 }) end, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||
|
||||
-- [[ Configure LSP ]]
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
-- NOTE: Remember that lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself
|
||||
-- many times.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
-- require('neodev').setup()
|
||||
|
||||
-- [[ Configure nvim-cmp ]]
|
||||
-- See `:help cmp`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
@@ -326,8 +260,10 @@ end
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
|
||||
-- options.lua sets vim.opt.termguicolors, which colorizer.lua (and others) need
|
||||
-- already set by the time they run their setup() calls, so it loads first
|
||||
require('custom.options')
|
||||
require('custom.catppuccin')
|
||||
-- require('custom.startup')
|
||||
require('custom.lua-line')
|
||||
require('custom.telescope')
|
||||
require('custom.lspconfig')
|
||||
@@ -335,7 +271,6 @@ require('custom.nvim-cmp')
|
||||
require('custom.toggleterm')
|
||||
require('custom.autopairs')
|
||||
require('custom.colorizer')
|
||||
require('custom.options')
|
||||
require('custom.keymaps')
|
||||
require('custom.harpoon')
|
||||
require('custom.mason')
|
||||
|
||||
@@ -47,5 +47,4 @@ require("catppuccin").setup({
|
||||
},
|
||||
})
|
||||
|
||||
-- setup must be called before loading
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
-- colorscheme is applied in custom/colortheme.lua, loaded after this file
|
||||
|
||||
@@ -5,4 +5,6 @@ if not setup then
|
||||
end
|
||||
|
||||
-- configure/enable colorizer
|
||||
colorizer.setup()
|
||||
colorizer.setup({
|
||||
options = { parsers = { css = true } },
|
||||
})
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set('i', 'jj', '<ESC>')
|
||||
@@ -56,16 +54,11 @@ keymap.set('n', '<leader>gh', ':DiffviewFileHistory %<CR>', { silent = true })
|
||||
-- toggleterm
|
||||
keymap.set('n', '<M-1>', '<cmd>ToggleTerm direction=horizontal<cr>', { silent = true })
|
||||
|
||||
-- vim-sneak
|
||||
-- keymap.set('n', 'f', '<Plug>Sneak_s', { silent = true })
|
||||
-- keymap.set('n', 'F', '<Plug>Sneak_S', { silent = true })
|
||||
-- keymap.set('n', 's', 's', { silent = true })
|
||||
|
||||
|
||||
-- easymotion
|
||||
keymap.set('n', '<leader>f', '<Plug>(easymotion-prefix)', { silent = true })
|
||||
keymap.set('n', '<leader>fs', '<Plug>(easymotion-sn)', { silent = true })
|
||||
keymap.set('n', '<leader>w', '<Plug>(easymotion-overwin-f2)', { silent = true })
|
||||
keymap.set('n', 'gl', '<Plug>(easymotion-sl)', { silent = true })
|
||||
|
||||
vim.g.EasyMotion_smartcase = 1
|
||||
|
||||
|
||||
@@ -33,15 +33,6 @@ vim.filetype.add({
|
||||
})
|
||||
|
||||
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-l>", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-v>", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-e>", ":lua require('kulala').set_selected_env()<CR>",
|
||||
-- { noremap = true, silent = true })
|
||||
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-k>", ":lua require('kulala').jump_prev()<CR>", { noremap = true, silent = true })
|
||||
-- vim.api.nvim_set_keymap("n", "<C-A-j>", ":lua require('kulala').jump_next()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<leader>rr", ":lua require('kulala').run()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<leader>rv", ":lua require('kulala').toggle_view()<CR>", { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<leader>re", ":lua require('kulala').set_selected_env()<CR>",
|
||||
|
||||
@@ -7,24 +7,6 @@
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
-- smart format with null-ls if available
|
||||
local function smart_format()
|
||||
vim.lsp.buf.format({
|
||||
filter = function(client)
|
||||
local ft = vim.bo.filetype
|
||||
if ft == "rust" then
|
||||
return client.name == "rust_analyzer"
|
||||
end
|
||||
-- Prefer null-ls for all non-Rust, otherwise allow anything
|
||||
if vim.tbl_contains({ "null-ls", "lua_ls", "jsonls", "tsserver" }, client.name) then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end,
|
||||
timeout_ms = 3000,
|
||||
})
|
||||
end
|
||||
|
||||
---------- border >------------------------------
|
||||
do
|
||||
local orig_floating_preview = vim.lsp.util.open_floating_preview
|
||||
@@ -55,11 +37,9 @@ local on_attach = function(_, bufnr)
|
||||
keymap.set("n", "g0", "<cmd>lua vim.lsp.buf.document_symbol()<CR>", opts)
|
||||
keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
-- keymap.set("n", "<leader>l", smart_format, opts)
|
||||
keymap.set("n", "<leader>l", function()
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = "Format code function" })
|
||||
keymap.set("n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
|
||||
keymap.set(
|
||||
"n",
|
||||
"<leader>cbf",
|
||||
@@ -82,9 +62,9 @@ local on_attach = function(_, bufnr)
|
||||
keymap.set("n", "<leader>dn", "<cmd>Lspsaga diagnostic_jump_next<CR>")
|
||||
keymap.set("n", "<leader>dp", "<cmd>Lspsaga diagnostic_jump_prev<CR>")
|
||||
|
||||
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_next_start('@function.outer')<CR>",
|
||||
keymap.set("n", "gj", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_next_start('@function.outer')<CR>",
|
||||
opts)
|
||||
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter.textobjects.move'.goto_previous_start('@function.outer')<CR>",
|
||||
keymap.set("n", "gk", "<cmd>lua require'nvim-treesitter-textobjects.move'.goto_previous_start('@function.outer')<CR>",
|
||||
opts)
|
||||
end
|
||||
|
||||
@@ -121,15 +101,6 @@ setup_server("rust_analyzer", {
|
||||
|
||||
|
||||
-- PHP LSPs
|
||||
local util = vim.lsp.util
|
||||
local root_dir = function(fname)
|
||||
return util.root_pattern("composer.json", ".git")(fname)
|
||||
or util.path.dirname(fname)
|
||||
end
|
||||
|
||||
local fallback_root_dir = function(fname)
|
||||
return util.root_pattern("composer.json", ".git")(fname) or util.path.dirname(fname)
|
||||
end
|
||||
|
||||
-- start it manually :LspStart phpactor
|
||||
-- setup_server("phpactor", {
|
||||
@@ -158,16 +129,8 @@ setup_server("intelephense", {
|
||||
init_options = {
|
||||
licenceKey = (function()
|
||||
local license_path = vim.fn.expand("$HOME/.config/intelephense/license.txt")
|
||||
<<<<<<< HEAD
|
||||
if vim.fn.filereadable(license_path) == 1 then
|
||||
return vim.fn.readfile(license_path)[1]
|
||||
=======
|
||||
local file = io.open(license_path, "r")
|
||||
if file then
|
||||
local content = file:read("*l") -- read first line
|
||||
file:close()
|
||||
return content
|
||||
>>>>>>> fbcc0b8d619e6f84448645f49d0a1dda9de840e5
|
||||
end
|
||||
return nil
|
||||
end)(),
|
||||
@@ -194,13 +157,12 @@ setup_server("intelephense", {
|
||||
-- phpcs / phpstan configs
|
||||
vim.g.nvim_phpcs_config_phpcs_path = 'phpcs'
|
||||
vim.g.nvim_phpcs_config_phpcbf_path = 'phpcbf'
|
||||
vim.g.ale_php_phpstan_executable = '/home/mace/.config/composer/vendor/bin/phpstan'
|
||||
|
||||
local phpcs_config = "/home/mace/repos/configs/phpcs.xml"
|
||||
local phpcs_config_new = "/home/mace/repos/dotfiles/phpcs.xml"
|
||||
if vim.loop.fs_stat(phpcs_config_new) then
|
||||
local phpcs_config = "~/repos/configs/phpcs.xml"
|
||||
local phpcs_config_new = "~/repos/dotfiles/phpcs.xml"
|
||||
if vim.uv.fs_stat(phpcs_config_new) then
|
||||
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config_new
|
||||
elseif vim.loop.fs_stat(phpcs_config) then
|
||||
elseif vim.uv.fs_stat(phpcs_config) then
|
||||
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config
|
||||
end
|
||||
|
||||
|
||||
+39
-9
@@ -1,5 +1,20 @@
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
-- phpstan: use the project's own phpstan.neon when there is one, otherwise fall
|
||||
-- back to the generic config in dotfiles.
|
||||
local phpstan_global_config = vim.fn.expand("~/repos/dotfiles/php/phpstan-global.neon")
|
||||
|
||||
-- returns the config path to pass via -c, or nil when phpstan can discover a
|
||||
-- local config itself (that also picks up its `includes:`, e.g. a baseline)
|
||||
local function phpstan_config_arg(root)
|
||||
for _, name in ipairs({ "phpstan.neon", "phpstan.neon.dist" }) do
|
||||
if vim.uv.fs_stat(root .. "/" .. name) then
|
||||
return nil
|
||||
end
|
||||
end
|
||||
return phpstan_global_config
|
||||
end
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.formatting.phpcbf.with({
|
||||
@@ -7,16 +22,32 @@ null_ls.setup({
|
||||
extra_args = { "--standard=PSR12", "--standard=phpcs.xml" },
|
||||
}),
|
||||
null_ls.builtins.diagnostics.phpstan.with({
|
||||
command = "phpstan",
|
||||
args = {
|
||||
"analyse",
|
||||
"--error-format", "raw",
|
||||
"--no-progress",
|
||||
"$FILENAME", -- or your project's entrypoint folder
|
||||
},
|
||||
method = null_ls.methods.DIAGNOSTICS_ON_SAVE, -- or ON_OPEN or BOTH
|
||||
-- prefer the project's own phpstan (extensions and baselines are
|
||||
-- version bound), fall back to the mason binary
|
||||
dynamic_command = function(params, done)
|
||||
local local_bin = params.root .. "/vendor/bin/phpstan"
|
||||
if vim.fn.executable(local_bin) == 1 then
|
||||
return done(local_bin)
|
||||
end
|
||||
return done("phpstan")
|
||||
end,
|
||||
args = function(params)
|
||||
local args = { "analyse", "--error-format", "json", "--no-progress" }
|
||||
local config = phpstan_config_arg(params.root)
|
||||
if config then
|
||||
vim.list_extend(args, { "-c", config })
|
||||
end
|
||||
table.insert(args, "$FILENAME")
|
||||
return args
|
||||
end,
|
||||
-- analyse the file on disk, not a copy in /tmp: phpstan needs the
|
||||
-- project's autoloader and its configured paths/scanDirectories
|
||||
method = null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
to_temp_file = false,
|
||||
timeout = 60000, -- a cold run easily exceeds null-ls' 5s default
|
||||
condition = function(utils)
|
||||
return utils.root_has_file({ "phpstan.neon", "phpstan.neon.dist" })
|
||||
or vim.uv.fs_stat(phpstan_global_config) ~= nil
|
||||
end,
|
||||
}),
|
||||
null_ls.builtins.diagnostics.phpcs.with({
|
||||
@@ -38,5 +69,4 @@ null_ls.setup({
|
||||
-- no extra_args needed if config file is correctly named and in root
|
||||
}),
|
||||
},
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
+10
-1
@@ -15,9 +15,10 @@ opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
|
||||
opt.wrap = false
|
||||
opt.breakindent = true
|
||||
|
||||
-- scroll offset
|
||||
vim.opt.scrolloff = 8
|
||||
opt.scrolloff = 8
|
||||
|
||||
-- search settings
|
||||
opt.smartcase = true
|
||||
@@ -29,6 +30,9 @@ opt.termguicolors = true
|
||||
opt.background = 'dark'
|
||||
opt.signcolumn = 'yes'
|
||||
|
||||
-- mouse
|
||||
opt.mouse = 'a'
|
||||
|
||||
-- clipboard
|
||||
opt.clipboard:append 'unnamedplus'
|
||||
|
||||
@@ -37,3 +41,8 @@ opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
opt.iskeyword:append '-'
|
||||
|
||||
-- undo & responsiveness
|
||||
opt.undofile = true
|
||||
opt.updatetime = 250
|
||||
opt.timeoutlen = 300
|
||||
|
||||
+25
-25
@@ -22,29 +22,26 @@ return {
|
||||
|
||||
-- vs-code like icons for autocompletion
|
||||
"onsails/lspkind.nvim",
|
||||
"catppuccin/nvim",
|
||||
as = "catppuccin",
|
||||
{ "startup-nvim/startup.nvim", dependencies = "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||
{ "catppuccin/nvim", name = "catppuccin" },
|
||||
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
require('lspsaga').setup({
|
||||
-- use enter to open file from the finder
|
||||
finder = {
|
||||
keys = { toggle_or_open = "<CR>" },
|
||||
},
|
||||
-- use enter to open file with definition preview
|
||||
definition = {
|
||||
keys = { edit = "<CR>" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter', -- optional
|
||||
'nvim-tree/nvim-web-devicons', -- optional
|
||||
},
|
||||
|
||||
move_in_saga = { prev = "<C-k>", next = "<C-j>" },
|
||||
-- use enter to open file with finder
|
||||
finder_action_keys = {
|
||||
open = "<CR>",
|
||||
},
|
||||
-- use enter to open file with definition preview
|
||||
definition_action_keys = {
|
||||
edit = "<CR>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Debugger
|
||||
@@ -60,7 +57,6 @@ return {
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
},
|
||||
"nvim-telescope/telescope-dap.nvim",
|
||||
-- autoclose parens, brackets, quotes, etc...
|
||||
"windwp/nvim-autopairs",
|
||||
|
||||
@@ -70,17 +66,23 @@ return {
|
||||
config = true
|
||||
},
|
||||
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
{
|
||||
"catgoose/nvim-colorizer.lua",
|
||||
event = "BufReadPre",
|
||||
opts = {},
|
||||
},
|
||||
"easymotion/vim-easymotion",
|
||||
|
||||
-- Markdown
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
ft = "markdown",
|
||||
build = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "iamcco/markdown-preview.nvim",
|
||||
-- cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
-- build = "cd app && yarn install",
|
||||
-- init = function()
|
||||
-- vim.g.mkdp_filetypes = { "markdown" }
|
||||
-- end,
|
||||
-- ft = { "markdown" },
|
||||
-- },
|
||||
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
@@ -96,8 +98,6 @@ return {
|
||||
}
|
||||
},
|
||||
|
||||
{ 'echasnovski/mini.icons', version = false },
|
||||
|
||||
{
|
||||
-- HTTP REST-Client Interface
|
||||
'mistweaverco/kulala.nvim',
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
-- import comment plugin safely
|
||||
local setup, startup = pcall(require, "startup")
|
||||
if not setup then
|
||||
return
|
||||
end
|
||||
|
||||
-- enable startup
|
||||
startup.setup({
|
||||
theme = "dashboard"
|
||||
})
|
||||
@@ -23,6 +23,9 @@ telescope.setup({
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
preview = {
|
||||
treesitter = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -57,9 +60,6 @@ vim.keymap.set('n', '<leader>/', function()
|
||||
end, { desc = '[/] Fuzzily search in current buffer' })
|
||||
|
||||
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
|
||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
|
||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
|
||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
|
||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
|
||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
|
||||
|
||||
@@ -43,21 +43,3 @@ end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
local Terminal = require("toggleterm.terminal").Terminal
|
||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
||||
|
||||
function _LAZYGIT_TOGGLE()
|
||||
lazygit:toggle()
|
||||
end
|
||||
|
||||
local node = Terminal:new({ cmd = "node", hidden = true })
|
||||
|
||||
function _NODE_TOGGLE()
|
||||
node:toggle()
|
||||
end
|
||||
|
||||
local python = Terminal:new({ cmd = "python3", hidden = true })
|
||||
|
||||
function _PYTHON_TOGGLE()
|
||||
python:toggle()
|
||||
end
|
||||
|
||||
+1
-27
@@ -1,26 +1,6 @@
|
||||
set number
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set smartcase
|
||||
set ignorecase
|
||||
set wrap
|
||||
set linebreak
|
||||
set smartindent
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set expandtab
|
||||
set splitright splitbelow
|
||||
set timeoutlen=1000
|
||||
set number
|
||||
set relativenumber
|
||||
set scrolloff=10
|
||||
|
||||
syntax on
|
||||
filetype indent on
|
||||
set smartindent
|
||||
|
||||
let mapleader = " "
|
||||
imap jj <Esc>
|
||||
imap <C-l> <Del>
|
||||
nnoremap <Leader>ü "+p
|
||||
|
||||
@@ -41,21 +21,15 @@ nnoremap <leader>a ggVG
|
||||
nnoremap ,b :buffers<CR>
|
||||
" nnoremap <leader>t :Explorer<CR>
|
||||
" use leader e instead
|
||||
nnoremap <leader>y "+yy
|
||||
vnoremap <leader>y "+y
|
||||
|
||||
:nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
":nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
|
||||
" xnoremap ("<leader>p", "\"_dP")
|
||||
" autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
|
||||
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>
|
||||
let g:python3_host_prog="/usr/bin/python3"
|
||||
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
" nnoremap <C-d> <C-d>zz
|
||||
" nnoremap <C-u> <C-u>zz
|
||||
|
||||
|
||||
Reference in New Issue
Block a user