add addons, some prefs
This commit is contained in:
parent
5aeddfdd5d
commit
d1a430248a
|
@ -83,7 +83,7 @@ git clone https://github.com/nvim-lua/kickstart.nvim.git %userprofile%\AppData\L
|
||||||
If you're using `powershell.exe`
|
If you're using `powershell.exe`
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
|
gimv /home/user/oldname /home/user/newnamet clone https://github.com/nvim-lua/kickstart.nvim.git $env:USERPROFILE\AppData\Local\nvim\
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
32
init.lua
32
init.lua
|
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||||
vim.g.have_nerd_font = false
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
-- See `:help vim.opt`
|
-- See `:help vim.opt`
|
||||||
|
@ -118,8 +118,15 @@ vim.opt.clipboard = 'unnamedplus'
|
||||||
-- Enable break indent
|
-- Enable break indent
|
||||||
vim.opt.breakindent = true
|
vim.opt.breakindent = true
|
||||||
|
|
||||||
|
-- My settings
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.backup = false
|
||||||
|
|
||||||
-- Save undo history
|
-- Save undo history
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
|
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
|
|
||||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||||
vim.opt.ignorecase = true
|
vim.opt.ignorecase = true
|
||||||
|
@ -238,7 +245,7 @@ require('lazy').setup({
|
||||||
-- require('Comment').setup({})
|
-- require('Comment').setup({})
|
||||||
|
|
||||||
-- "gc" to comment visual regions/lines
|
-- "gc" to comment visual regions/lines
|
||||||
{ 'numToStr/Comment.nvim', opts = {} },
|
{ 'numToStr/Comment.nvim', opts = {} },
|
||||||
|
|
||||||
-- Here is a more advanced example where we pass configuration
|
-- Here is a more advanced example where we pass configuration
|
||||||
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
|
||||||
|
@ -273,7 +280,7 @@ require('lazy').setup({
|
||||||
-- after the plugin has been loaded:
|
-- after the plugin has been loaded:
|
||||||
-- config = function() ... end
|
-- config = function() ... end
|
||||||
|
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
|
@ -325,7 +332,7 @@ require('lazy').setup({
|
||||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||||
|
|
||||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||||
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
||||||
|
@ -418,11 +425,11 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- Useful status updates for LSP.
|
-- Useful status updates for LSP.
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||||
{ 'j-hui/fidget.nvim', opts = {} },
|
{ 'j-hui/fidget.nvim', opts = {} },
|
||||||
|
|
||||||
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
|
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||||
-- used for completion, annotations and signatures of Neovim apis
|
-- used for completion, annotations and signatures of Neovim apis
|
||||||
{ 'folke/neodev.nvim', opts = {} },
|
{ 'folke/neodev.nvim', opts = {} },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Brief aside: **What is LSP?**
|
-- Brief aside: **What is LSP?**
|
||||||
|
@ -605,9 +612,9 @@ require('lazy').setup({
|
||||||
-- You can add other tools here that you want Mason to install
|
-- You can add other tools here that you want Mason to install
|
||||||
-- for you, so that they are available from within Neovim.
|
-- for you, so that they are available from within Neovim.
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
--vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
-- 'stylua', -- Used to format Lua code
|
||||||
})
|
--})
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
|
@ -785,7 +792,8 @@ require('lazy').setup({
|
||||||
-- Like many other themes, this one has different styles, and you could load
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
vim.cmd.colorscheme 'tokyonight-night'
|
||||||
|
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
|
||||||
|
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
|
||||||
-- You can configure highlights by doing something like:
|
-- You can configure highlights by doing something like:
|
||||||
vim.cmd.hi 'Comment gui=none'
|
vim.cmd.hi 'Comment gui=none'
|
||||||
end,
|
end,
|
||||||
|
@ -835,7 +843,7 @@ require('lazy').setup({
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
build = ':TSUpdate',
|
build = ':TSUpdate',
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'python' },
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
@ -885,7 +893,7 @@ require('lazy').setup({
|
||||||
--
|
--
|
||||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||||
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
||||||
-- { import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}, {
|
}, {
|
||||||
ui = {
|
ui = {
|
||||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
return {
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||||
|
|
||||||
|
local Chibs_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {})
|
||||||
|
|
||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
autocmd("BufWinEnter", {
|
||||||
|
group = Chibs_Fugitive,
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
if vim.bo.ft ~= "fugitive" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
local opts = { buffer = bufnr, remap = false }
|
||||||
|
vim.keymap.set("n", "<leader>p", function()
|
||||||
|
vim.cmd.Git('push')
|
||||||
|
end, opts)
|
||||||
|
|
||||||
|
-- rebase always
|
||||||
|
vim.keymap.set("n", "<leader>P", function()
|
||||||
|
vim.cmd.Git({ 'pull', '--rebase' })
|
||||||
|
end, opts)
|
||||||
|
|
||||||
|
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
|
||||||
|
-- needed if i did not set the branch up correctly
|
||||||
|
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set("n", "gu", "<cmd>diffget //2<CR>")
|
||||||
|
vim.keymap.set("n", "gh", "<cmd>diffget //3<CR>")
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
return {
|
||||||
|
"mbbill/undotree",
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||||
|
end
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
return {
|
||||||
|
"folke/zen-mode.nvim",
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>zz", function()
|
||||||
|
require("zen-mode").setup {
|
||||||
|
window = {
|
||||||
|
width = 90,
|
||||||
|
options = {}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require("zen-mode").toggle()
|
||||||
|
vim.wo.wrap = false
|
||||||
|
vim.wo.number = true
|
||||||
|
vim.wo.rnu = true
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>zZ", function()
|
||||||
|
require("zen-mode").setup {
|
||||||
|
window = {
|
||||||
|
width = 80,
|
||||||
|
options = {}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require("zen-mode").toggle()
|
||||||
|
vim.wo.wrap = false
|
||||||
|
vim.wo.number = false
|
||||||
|
vim.wo.rnu = false
|
||||||
|
vim.opt.colorcolumn = "0"
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
}
|
Loading…
Reference in New Issue