commit
62ad4164ba
44
init.lua
44
init.lua
|
@ -42,6 +42,9 @@ P.S. You can delete this when you're done too. It's your config now :)
|
|||
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.wo.relativenumber = true
|
||||
|
||||
-- Install package manager
|
||||
-- https://github.com/folke/lazy.nvim
|
||||
|
@ -61,7 +64,7 @@ vim.opt.rtp:prepend(lazypath)
|
|||
|
||||
-- NOTE: Here is where you install your plugins.
|
||||
-- You can configure plugins using the `config` key.
|
||||
--
|
||||
|
||||
-- You can also configure plugins after the setup call,
|
||||
-- as they will be available in your neovim runtime.
|
||||
require('lazy').setup({
|
||||
|
@ -89,7 +92,7 @@ require('lazy').setup({
|
|||
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
'folke/neodev.nvim',
|
||||
'folke/neodev.nvim'
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -165,7 +168,7 @@ require('lazy').setup({
|
|||
-- See `:help lualine.txt`
|
||||
opts = {
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
icons_enabled = true,
|
||||
theme = 'onedark',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
|
@ -218,8 +221,8 @@ require('lazy').setup({
|
|||
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
||||
-- These are some example plugins that I've included in the kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them.
|
||||
-- require 'kickstart.plugins.autoformat',
|
||||
-- require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.autoformat',
|
||||
require 'kickstart.plugins.debug',
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
|
||||
|
@ -227,7 +230,7 @@ require('lazy').setup({
|
|||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
--
|
||||
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
||||
-- { import = 'custom.plugins' },
|
||||
{ import = 'custom.plugins' },
|
||||
}, {})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
|
@ -395,6 +398,27 @@ vim.defer_fn(function()
|
|||
},
|
||||
}
|
||||
end, 0)
|
||||
-- Nvim-Tree keymaps
|
||||
|
||||
vim.keymap.set('n', '<leader>t', ':NvimTreeToggle<CR>', { desc = 'Toggle File Tree' })
|
||||
|
||||
-- Terminal Keymaps
|
||||
function OpenNewTerminalWithAdjustedHeight(height)
|
||||
vim.cmd(':bo new')
|
||||
vim.cmd(':term')
|
||||
vim.cmd(':resize' .. height)
|
||||
vim.cmd('wincmd w')
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>T', ':lua OpenNewTerminalWithAdjustedHeight(20)<CR>', { desc = 'Open new terminal' })
|
||||
vim.keymap.set('t', '<esc>', '<C-\\><C-N>', { desc = 'Exit terminal mode' })
|
||||
vim.keymap.set('n', '|', ':vsplit new | terminal<CR>', { desc = 'Split Terminal' })
|
||||
vim.keymap.set('t', '<C-c>', '<C-c><CR>', { desc = 'terminate running command' })
|
||||
-- Moving Windows Keymaps
|
||||
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to the window to the left' })
|
||||
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Move to the window to the right' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Move to the window above' })
|
||||
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to the window below' })
|
||||
|
||||
-- Diagnostic keymaps
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
||||
|
@ -473,11 +497,11 @@ require('mason-lspconfig').setup()
|
|||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
gopls = {},
|
||||
pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
tsserver = {},
|
||||
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
|
||||
"auto-save.nvim": { "branch": "main", "commit": "979b6c82f60cfa80f4cf437d77446d0ded0addf0" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "5a9a6ac29a7805c4783cda21b80a1e361964b3f2" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "046e2cf04e08ece927bacbfb87c5b35c0b636546" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7118be1ffe2b8d0a2bdeddf5b62af3b1bede1d76" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" },
|
||||
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "d617d9eb27e73e701e446874c6ea2cb528719260" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
|
||||
"nvim-dap": { "branch": "master", "commit": "3eb26a63a3674e3722182a92f21d04c4e5ce0f43" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "a5cc8dcad43f0732585d4793deb02a25c4afb766" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "6428fcab6f3c09e934bc016c329806314384a41e" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "107e61afb7129d637ea6c3c68b97a22194b0bf16" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "eb208bfdfcf76efea0424747e23e44641e13aaa6" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "b9acd92ded2ba155867ca5af9d618e933d96e3b0" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
end,
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
return {
|
||||
'pocco81/auto-save.nvim',
|
||||
opts = {
|
||||
enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it)
|
||||
execution_message = {
|
||||
message = function() -- message to print on save
|
||||
return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S"))
|
||||
end,
|
||||
dim = 0.18, -- dim the color of `message`
|
||||
cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea
|
||||
},
|
||||
trigger_events = { "InsertLeave", "TextChanged" }, -- vim events that trigger auto-save. See :h events
|
||||
-- function that determines whether to save the current buffer or not
|
||||
-- return true: if buffer is ok to be saved
|
||||
-- return false: if it's not ok to be saved
|
||||
condition = function(buf)
|
||||
local fn = vim.fn
|
||||
local utils = require("auto-save.utils.data")
|
||||
|
||||
if
|
||||
fn.getbufvar(buf, "&modifiable") == 1 and
|
||||
utils.not_in(fn.getbufvar(buf, "&filetype"), {}) then
|
||||
return true -- met condition(s), can save
|
||||
end
|
||||
return false -- can't save
|
||||
end,
|
||||
write_all_buffers = false, -- write all buffers when the current one meets `condition`
|
||||
debounce_delay = 135, -- saves the file at most every `debounce_delay` milliseconds
|
||||
callbacks = { -- functions to be executed at different intervals
|
||||
enabling = nil, -- ran when enabling auto-save
|
||||
disabling = nil, -- ran when disabling auto-save
|
||||
before_asserting_save = nil, -- ran before checking `condition`
|
||||
before_saving = nil, -- ran before doing the actual save
|
||||
after_saving = nil -- ran after doing the actual save
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
-- You can add your own plugins here or in other files in this directory!
|
||||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
return {
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
version = "*",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
|
||||
config = function()
|
||||
require("nvim-tree").setup {
|
||||
}
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue