mirror of
https://github.com/kristoferssolo/SoloVim.git
synced 2025-10-21 20:10:41 +00:00
Minor changes
This commit is contained in:
parent
3728ed740f
commit
14bd26070a
@ -25,11 +25,11 @@ dashboard.section.header.val = header()
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("f", " " .. " Find file", "<cmd>Telescope find_files <cr>"),
|
||||
dashboard.button("e", " " .. " New file", "<cmd>ene <BAR> startinsert <cr>"),
|
||||
dashboard.button("p", " " .. " Persistence", "<cmd>lua require('persistence').load()<cr>"),
|
||||
dashboard.button("\\", " " .. " Persistence", "<cmd>lua require('persistence').load()<cr>"),
|
||||
dashboard.button("r", " " .. " Recent files", "<cmd>Telescope oldfiles <cr>"),
|
||||
dashboard.button("t", " " .. " Find text", "<cmd>Telescope live_grep <cr>"),
|
||||
dashboard.button(
|
||||
"P",
|
||||
"p",
|
||||
" " .. " Find project",
|
||||
"<cmd>lua require('telescope').extensions.projects.projects()<cr>"
|
||||
),
|
||||
|
||||
@ -76,6 +76,14 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
end,
|
||||
})
|
||||
|
||||
local function SetColorScheme(color)
|
||||
color = color or "dracula"
|
||||
vim.cmd.colorscheme(color)
|
||||
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||
end
|
||||
SetColorScheme()
|
||||
|
||||
-- Change Cursorline/Columnt color
|
||||
vim.cmd([[
|
||||
highlight CursorLine ctermbg=White cterm=bold guibg=#222222
|
||||
@ -110,3 +118,12 @@ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
vim.cmd.source(file_path)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Run PackerSync on file save
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
|
||||
pattern = { "**/plugins.lua" },
|
||||
callback = function()
|
||||
vim.cmd.PackerSync()
|
||||
end,
|
||||
})
|
||||
|
||||
@ -4,6 +4,7 @@ local opts = { silent = true }
|
||||
--Remap space as leader key
|
||||
keymap("", "<Space>", "<Nop>", opts)
|
||||
keymap("n", "q", "<Nop>", opts)
|
||||
keymap("n", "Q", "<Nop>", opts)
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- Modes
|
||||
@ -47,7 +48,9 @@ keymap("n", "<A-k>", "<cmd>m .-2<cr>==", opts)
|
||||
keymap("n", "]q", "<cmd>cnext<cr>", opts)
|
||||
keymap("n", "[q", "<cmd>cprev<cr>", opts)
|
||||
|
||||
keymap("n", "<S-s>", ":%s///gi<Left><Left><Left><Left>", {})
|
||||
keymap("n", "<S-s>", ":%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>", {})
|
||||
|
||||
keymap("n", "<S-j>", "mzJ`z")
|
||||
|
||||
-- Insert --
|
||||
-- Press jk fast to enter
|
||||
@ -67,10 +70,13 @@ keymap("i", "<A-Right>", "<C-\\><C-N><C-w>l", opts)
|
||||
keymap("v", "<", "<gv", opts)
|
||||
keymap("v", ">", ">gv", opts)
|
||||
|
||||
-- keymap("v", "<A-j>", "<cmd>m '>+1<cr>gv=gv")
|
||||
-- keymap("v", "<A-k>", "<cmd>m '<-2<cr>gv=gv")
|
||||
|
||||
-- Visual Block --
|
||||
-- Move current line / block with Alt-j/k ala vscode.
|
||||
keymap("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
|
||||
keymap("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
|
||||
-- keymap("x", "<A-j>", "<cmd>move '>+1<cr>gv-gv", opts)
|
||||
-- keymap("x", "<A-k>", "<cmd>move '<-2<cr>gv-gv", opts)
|
||||
|
||||
-- Command --
|
||||
-- navigate tab completion with <c-j> and <c-k>
|
||||
|
||||
@ -18,7 +18,7 @@ M.setup = function()
|
||||
{ name = "DiagnosticSignInfo", text = "" },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
for _, sign in pairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" })
|
||||
end
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
local status_ok, _ = pcall(require, "mason-lspconfig")
|
||||
if not status_ok then
|
||||
return
|
||||
return
|
||||
end
|
||||
|
||||
require("user.mason.mason-installer")
|
||||
|
||||
@ -5,7 +5,8 @@ local options = {
|
||||
completeopt = { "menuone", "noselect" }, -- mostly just for cmp
|
||||
conceallevel = 0, -- so that `` is visible in markdown files
|
||||
fileencoding = "utf-8", -- the encoding written to a file
|
||||
hlsearch = true, -- highlight all matches on previous search pattern
|
||||
hlsearch = false, -- highlight all matches on previous search pattern
|
||||
incsearch = true,
|
||||
ignorecase = true, -- ignore case in search patterns
|
||||
mouse = "a", -- allow the mouse to be used in neovim
|
||||
pumheight = 10, -- pop up menu height
|
||||
@ -19,7 +20,8 @@ local options = {
|
||||
termguicolors = true, -- set term gui colors (most terminals support this)
|
||||
timeoutlen = 250, -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
undofile = true, -- enable persistent undo
|
||||
updatetime = 300, -- faster completion (4000ms default)
|
||||
undodir = os.getenv("XDG_DATA_HOME") .. "//nvim/undodir",
|
||||
updatetime = 50, -- faster completion (4000ms default)
|
||||
writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
|
||||
expandtab = true, -- convert tabs to spaces
|
||||
shiftwidth = 4, -- the number of spaces inserted for each indentation
|
||||
|
||||
@ -21,14 +21,6 @@ if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
group = vim.api.nvim_create_augroup("AutoPackerSync", { clear = true }),
|
||||
pattern = { "**/plugins.lua" },
|
||||
callback = function()
|
||||
vim.cmd.PackerSync()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init({
|
||||
display = {
|
||||
@ -59,6 +51,7 @@ return packer.startup(function(use)
|
||||
use("NvChad/nvim-colorizer.lua")
|
||||
use("alvan/vim-closetag")
|
||||
use("tpope/vim-surround")
|
||||
use("mbbill/undotree")
|
||||
|
||||
use("folke/which-key.nvim")
|
||||
use("folke/todo-comments.nvim")
|
||||
@ -110,14 +103,15 @@ return packer.startup(function(use)
|
||||
use("simrat39/rust-tools.nvim")
|
||||
|
||||
-- Telescope
|
||||
use({ "nvim-telescope/telescope.nvim", run = ":TSUpdate" })
|
||||
use("nvim-telescope/telescope.nvim")
|
||||
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
|
||||
use("nvim-telescope/telescope-media-files.nvim")
|
||||
use("xiyaowong/telescope-emoji.nvim")
|
||||
use("nvim-telescope/telescope-frecency.nvim")
|
||||
|
||||
-- Treesitter
|
||||
use("nvim-treesitter/nvim-treesitter")
|
||||
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
|
||||
use("nvim-treesitter/playground")
|
||||
use("p00f/nvim-ts-rainbow")
|
||||
use("mechatroner/rainbow_csv")
|
||||
use("mtdl9/vim-log-highlighting")
|
||||
@ -136,6 +130,6 @@ return packer.startup(function(use)
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
-- Put this at the end after all plugins
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
vim.cmd.PackerSync()
|
||||
end
|
||||
end)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user