feat: refactor

This commit is contained in:
2022-04-25 16:23:14 +02:00
parent 4bf6a46a85
commit b0e54888bb
16 changed files with 369 additions and 371 deletions

View File

@ -22,10 +22,9 @@ augroup SaveManualFolds
augroup END
]]
vim.cmd [[autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb()]]
vim.api.nvim_create_autocmd("BufWritePre",{
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function()
vim.lsp.buf.formatting_sync();
end

View File

@ -1,14 +1,14 @@
local map = vim.api.nvim_set_keymap
local g = vim.g
local options = {noremap = true}
local remap = {noremap = false}
local options = { noremap = true }
local remap = { noremap = false }
g.mapleader = " "
map("n", "<C-o>", ":Telescope find_files<CR>", options)
map("n", "<C-f>", ":Telescope live_grep<CR>", options)
map("n","<C-p>",":Telescope command_center<CR>",options)
map("n", "<C-p>", ":Telescope command_center<CR>", options)
map("n", "<Shift>", "za", options)
-- LSP Functionality
@ -32,16 +32,21 @@ map("n", "<C-k>", "<C-w>k", options)
map("n", "<C-l>", "<C-w>l", options)
-- Browser like next/previous
map("n", "<A-Left>", ":bprevious<CR>",options);
map("n", "<A-Right>", ":bnext<CR>",options);
map("n", "<A-Left>", ":bprevious<CR>", options);
map("n", "<A-Right>", ":bnext<CR>", options);
-- Backspace Delete like Browser
map('i', '<C-H>', '<Esc>caw', options)
map("n", "Y", "yy", options)
-- Copy visual selection to keyboard
map("v", "Y", '"+y', options)
map("n", "<Leader>k", "{", options)
map("n", "<Leader>j", "}", options)
-- Don't accidently create macros when trying to quit
map('n', 'Q', 'q', {})
map('n', 'q', '<nop>', {})
-- Move lines vscode style
map("n", "<A-j>", "<cmd>move +1<CR>", options)
map("n", "<A-k>", "<cmd>move -2<CR>", options)
@ -60,8 +65,8 @@ map("n", "<Leader>gdh", ":diffget //2<CR>", options)
-- Find file in NvimTree
map("n", "<Leader>f", ":NvimTreeFindFile<CR><c-w>", options)
map("n", "<C-->",":vsplit<CR>",options);
map("n", "<C-|>",":split<CR>",options);
map("n", "<C-->", ":vsplit<CR>", options);
map("n", "<C-|>", ":split<CR>", options);
-- I aint no weak boy
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", options)

View File

@ -1,63 +1,62 @@
-------------
-- General --
-------------
local set = vim.opt
set.swapfile = false -- Don't use swapfile
set.updatetime = 0 -- Faster completion
set.encoding="utf-8" -- The encoding displayed
set.fileencoding="utf-8" -- The encoding written to file
set.smartindent = true -- Makes indenting smart
set.iskeyword:append("-") -- treat dash separated words as a word text object"
set.clipboard = "unnamedplus" -- Copy paste between vim and everything else
set.smarttab = true -- Makes tabbing smarter will realize you have 2 vs 4
set.expandtab = true -- Converts tabs to spaces
set.autoindent = true -- Good auto indent
set.autochdir = true -- Your working directory will always be the same as your working directory
set.incsearch = true -- sets incremental search
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
set.shortmess:append "sI" -- Disable nvim intro
vim.cmd [[set nobackup]] -- creates a backup file
vim.cmd [[set nowritebackup]] -- creates a backup file i guess
vim.cmd [[set formatoptions-=cro]] -- Stop newline continution of comments
vim.cmd [[set complete+=kspell]] -- auto complete with spellcheck
vim.cmd [[set completeopt=menuone,longest]] -- auto complete menu (It's pretty great)
vim.cmd [[set nocompatible]] -- Disable compatibility to old-time vi
set.mouse = 'a' -- Enable mouse support
set.swapfile = false -- Don't use swapfile
set.updatetime = 0 -- Faster completion
set.encoding = "utf-8" -- The encoding displayed
set.fileencoding = "utf-8" -- The encoding written to file
set.smartindent = true -- Makes indenting smart
set.iskeyword:append("-") -- treat dash separated words as a word text object"
set.clipboard = "unnamedplus" -- Copy paste between vim and everything else
set.smarttab = true -- Makes tabbing smarter will realize you have 2 vs 4
set.expandtab = true -- Converts tabs to spaces
set.autoindent = true -- Good auto indent
set.autochdir = true -- Your working directory will always be the same as your working directory
set.incsearch = true -- sets incremental search
set.shell = "/bin/zsh" -- Set your shell to bash or zsh
set.shortmess:append "sI" -- Disable nvim intro
vim.cmd [[set nobackup]] -- creates a backup file
vim.cmd [[set nowritebackup]] -- creates a backup file i guess
vim.cmd [[set formatoptions-=cro]] -- Stop newline continution of comments
vim.cmd [[set complete+=kspell]] -- auto complete with spellcheck
vim.cmd [[set completeopt=menuone,longest]] -- auto complete menu (It's pretty great)
vim.cmd [[set nocompatible]] -- Disable compatibility to old-time vi
set.mouse = 'a' -- Enable mouse support
---------------
-- Neovim UI --
---------------
set.pumheight = 15 -- Makes popup menu smaller
set.ruler = true -- Show the cursor position all the time
set.splitbelow = true -- Horizontal splits will automatically be below
set.splitright = true -- Vertical splits will automatically be to the right
set.conceallevel = 0 -- So that I can see `` in markdown files
set.tabstop = 2 -- Insert 2 spaces for a tab
set.number = true -- Line numbers
set.background = "dark" -- tell vim what the background color looks like
set.virtualedit = "onemore" -- With This option you can move the cursor one character over the end
set.ignorecase = true -- ignores case when searching
set.smartcase = true -- turns on case sensitive search when letters are capitalized
set.termguicolors = true -- set term gui colors (most terminals support this)
set.laststatus=2 -- Always display the status line
set.title = true -- Show current txt that you editing
set.relativenumber = false -- Vims absolute, relative and hybrid line numbers
set.cursorline = false -- Enable highlighting of the current line
set.shiftwidth = 2 -- Change the number of space characters inserted for indentation
set.showtabline = 1 -- Always show tabs
set.cmdheight = 1 -- More space for displaying messages
vim.cmd [[set nowrap]] -- Display long lines as just one line
vim.cmd [[set noshowmode]] -- We don't need to see things like -- INSERT -- anymore
vim.cmd [[syntax enable]] -- Enables syntax highlighing
vim.cmd [[set t_Co=256]] -- Support 256 colors
set.pumheight = 15 -- Makes popup menu smaller
set.ruler = true -- Show the cursor position all the time
set.splitbelow = true -- Horizontal splits will automatically be below
set.splitright = true -- Vertical splits will automatically be to the right
set.conceallevel = 0 -- So that I can see `` in markdown files
set.tabstop = 2 -- Insert 2 spaces for a tab
set.number = true -- Line numbers
set.background = "dark" -- tell vim what the background color looks like
set.virtualedit = "onemore" -- With This option you can move the cursor one character over the end
set.ignorecase = true -- ignores case when searching
set.smartcase = true -- turns on case sensitive search when letters are capitalized
set.termguicolors = true -- set term gui colors (most terminals support this)
set.laststatus = 2 -- Always display the status line
set.title = true -- Show current txt that you editing
set.relativenumber = false -- Vims absolute, relative and hybrid line numbers
set.cursorline = false -- Enable highlighting of the current line
set.shiftwidth = 2 -- Change the number of space characters inserted for indentation
set.showtabline = 1 -- Always show tabs
set.cmdheight = 1 -- More space for displaying messages
vim.cmd [[set nowrap]] -- Display long lines as just one line
vim.cmd [[set noshowmode]] -- We don't need to see things like -- INSERT -- anymore
vim.cmd [[syntax enable]] -- Enables syntax highlighing
vim.cmd [[set t_Co=256]] -- Support 256 colors
-- vim.cmd "set whichwrap+=<,>,[,],h,l" -- Breaks Space-Time Continuum
-----------------
-- Memory, CPU --
-----------------
set.hidden = true -- Required to keep multiple buffers open multiple buffers
set.timeoutlen = 500 -- By default timeoutlen is 1000 ms
set.lazyredraw = true -- Disable lazyredraw
set.synmaxcol = 240 -- Max column for syntax highlight
set.updatetime = 700 -- ms to wait for trigger an event
set.hidden = true -- Required to keep multiple buffers open multiple buffers
set.timeoutlen = 500 -- By default timeoutlen is 1000 ms
set.lazyredraw = true -- Disable lazyredraw
set.synmaxcol = 240 -- Max column for syntax highlight
set.updatetime = 700 -- ms to wait for trigger an event

View File

@ -1,96 +1,79 @@
return require("packer").startup(
function(use)
-- Let packer manage itself
use "wbthomason/packer.nvim"
function(use)
-- Let packer manage itself
use "wbthomason/packer.nvim"
use 'lewis6991/impatient.nvim'
use 'lewis6991/impatient.nvim'
-- General Helper Functions
use "nvim-lua/plenary.nvim"
-- General Helper Functions
use "nvim-lua/plenary.nvim"
-- Theming Section
use "EdenEast/nightfox.nvim"
use "nvim-lualine/lualine.nvim"
-- Filetype Detection
-- use "nathom/filetype.nvim"
-- Layout Plugins
use "kyazdani42/nvim-web-devicons"
use "kyazdani42/nvim-tree.lua"
use "nvim-lua/popup.nvim"
-- use "mhinz/vim-startify"
use 'goolord/alpha-nvim'
use { "terrortylor/nvim-comment", config = function() require('nvim_comment').setup() end }
use "windwp/nvim-autopairs"
-- Theming Section
-- use 'folke/tokyonight.nvim'
use "EdenEast/nightfox.nvim"
use "nvim-lualine/lualine.nvim"
-- use "xiyaowong/nvim-transparent"
-- Code Navigation
use "junegunn/fzf"
use "nvim-telescope/telescope.nvim"
use "gfeiyou/command-center.nvim"
-- Layout Plugins
use "kyazdani42/nvim-web-devicons"
use "kyazdani42/nvim-tree.lua"
use "nvim-lua/popup.nvim"
use "mhinz/vim-startify"
-- use "tpope/vim-fugitive"
use "tpope/vim-commentary"
-- use "tpope/vim-surround"
-- use "lambdalisue/suda.vim"
use "windwp/nvim-autopairs"
-- Postman like features
-- use "NTBBloodbath/rest.nvim"
-- Code Navigation
-- use "alexghergh/nvim-tmux-navigation"
-- use "dense-analysis/ale"
-- use "nathanmsmith/nvim-ale-diagnostic"
use "junegunn/fzf"
use "nvim-telescope/telescope.nvim"
use "gfeiyou/command-center.nvim"
-- Obsidian / Roam like features
-- use "lervag/wiki.vim"
-- Postman like features
-- use "NTBBloodbath/rest.nvim"
use "rcarriga/nvim-notify"
-- Obsidian / Roam like features
-- use "lervag/wiki.vim"
use "rcarriga/nvim-notify"
-- Lsp Errors
use "folke/lsp-colors.nvim"
use "kosayoda/nvim-lightbulb"
-- use "onsails/lspkind-nvim"
use {
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup {}
end
}
-- Syntax / Autocomplete
-- use "terminalnode/sway-vim-syntax" --sway config syntax
use "neovim/nvim-lspconfig"
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/cmp-nvim-lua"
use "hrsh7th/cmp-path"
use "hrsh7th/cmp-calc"
use "hrsh7th/cmp-buffer"
use "hrsh7th/cmp-cmdline"
use "rafamadriz/friendly-snippets"
use "L3MON4D3/LuaSnip"
use "saadparwaiz1/cmp_luasnip"
use "williamboman/nvim-lsp-installer"
use "nvim-lua/lsp-status.nvim"
-- use "jose-elias-alvarez/nvim-lsp-ts-utils"
-- use "neoclide/jsonc.vim"
use "brymer-meneses/grammar-guard.nvim"
use {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate"
}
-- Autoformat
-- use "sbdchd/neoformat"
use "lukas-reineke/lsp-format.nvim"
-- use "lukas-reineke/format.nvim"
-- General Popup Window
use "akinsho/nvim-toggleterm.lua"
use "rktjmp/fwatch.nvim"
-- Database Feature
use "tpope/vim-dadbod"
use "kristijanhusak/vim-dadbod-ui"
-- Lsp Errors
use "folke/lsp-colors.nvim"
use "kosayoda/nvim-lightbulb"
use {
"folke/trouble.nvim",
requires = "kyazdani42/nvim-web-devicons",
config = function()
require("trouble").setup {}
end
}
-- Syntax / Autocomplete
use "neovim/nvim-lspconfig"
use "hrsh7th/nvim-cmp"
use "hrsh7th/cmp-nvim-lsp"
use "hrsh7th/cmp-nvim-lua"
use "hrsh7th/cmp-path"
use "hrsh7th/cmp-calc"
use "hrsh7th/cmp-buffer"
use "hrsh7th/cmp-cmdline"
use "rafamadriz/friendly-snippets"
use "L3MON4D3/LuaSnip"
use "saadparwaiz1/cmp_luasnip"
use "williamboman/nvim-lsp-installer"
use "nvim-lua/lsp-status.nvim"
use "brymer-meneses/grammar-guard.nvim"
use {
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate"
}
-- Autoformat
use "lukas-reineke/lsp-format.nvim"
-- General Popup Window
use "akinsho/nvim-toggleterm.lua"
use "rktjmp/fwatch.nvim"
-- Database Feature
use "tpope/vim-dadbod"
use "kristijanhusak/vim-dadbod-ui"
end
)

View File

@ -0,0 +1,9 @@
-- Enable Theming / Syntax
require("nightfox").setup({
options = {
transparent = true
}
})
vim.cmd("colorscheme nightfox")
require "utils.theme-reloader"
require "configs.lualine"