Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
morpheuslord authored Nov 11, 2022
1 parent 022ee3b commit 09a59f0
Show file tree
Hide file tree
Showing 58 changed files with 4,386 additions and 0 deletions.
4 changes: 4 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('plugins')
require('keybindings')
require('options')
require('colorscheme')
4 changes: 4 additions & 0 deletions lua/autopairs-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require('nvim-autopairs').setup({check_ts = true})
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp')
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({map_char = {tex = ''}}))
11 changes: 11 additions & 0 deletions lua/blankline-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require("indent_blankline").setup {
buftype_exclude = {"terminal"},
filetype_exclude = {"dashboard", "NvimTree", "packer", "lsp-installer"},
show_current_context = true,
context_patterns = {
"class", "return", "function", "method", "^if", "^while", "jsx_element", "^for", "^object",
"^table", "block", "arguments", "if_statement", "else_clause", "jsx_element",
"jsx_self_closing_element", "try_statement", "catch_clause", "import_statement",
"operation_type"
}
}
5 changes: 5 additions & 0 deletions lua/bufferline-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require("bufferline").setup {}
vim.cmd [[
nnoremap <silent><TAB> :BufferLineCycleNext<CR>
nnoremap <silent><S-TAB> :BufferLineCyclePrev<CR>
]]
1 change: 1 addition & 0 deletions lua/colorizer-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require'colorizer'.setup()
6 changes: 6 additions & 0 deletions lua/colorscheme/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- vim.cmd("colorscheme nighfly")
local status, _ = pcall(vim.cmd, "colorscheme carbonfox")
if not status then
print("Colorscheme Not Found !!!!!")
return
end
5 changes: 5 additions & 0 deletions lua/comment-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require('nvim_comment').setup({
line_mapping = "<leader>cl",
operator_mapping = "<leader>c",
comment_empty = false
})
30 changes: 30 additions & 0 deletions lua/dashboard-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
vim.g.dashboard_default_executive = 'telescope'
vim.g.dashboard_custom_header = {
[[ ▄▄▄▄▄▄▄▄▄ ]],
[[ ▄█████████████▄ ]],
[[ █████ █████████████████ █████ ]],
[[ ▐████▌ ▀███▄ ▄███▀ ▐████▌ ]],
[[ █████▄ ▀███▄ ▄███▀ ▄█████ ]],
[[ ▐██▀███▄ ▀███▄███▀ ▄███▀██▌ ]],
[[ ███▄▀███▄ ▀███▀ ▄███▀▄███ ]],
[[ ▐█▄▀█▄▀███ ▄ ▀ ▄ ███▀▄█▀▄█▌ ]],
[[ ███▄▀█▄██ ██▄██ ██▄█▀▄███ ]],
[[ ▀███▄▀██ █████ ██▀▄███▀ ]],
[[ █▄ ▀█████ █████ █████▀ ▄█ ]],
[[ ███ ███ ███ ]],
[[ ███▄ ▄█ ███ █▄ ▄███ ]],
[[ █████ ▄███ ███ ███▄ █████ ]],
[[ █████ ████ ███ ████ █████ ]],
[[ █████ ████▄▄▄▄▄████ █████ ]],
[[ ▀███ █████████████ ███▀ ]],
[[ ▀█ ███ ▄▄▄▄▄ ███ █▀ ]],
[[ ▀█▌▐█████▌▐█▀ ]],
[[ ███████ ]]
}
vim.g.dashboard_custom_section = {
a = {description = {' Find File '}, command = 'Telescope find_files'},
d = {description = {' Search Text '}, command = 'Telescope live_grep'},
b = {description = {' Recent Files '}, command = 'Telescope oldfiles'},
e = {description = {' Config '}, command = 'edit ~/.config/nvim/init.lua'}
}
vim.g.dashboard_custom_footer = {'Do one thing, do it well - Unix Philosophy'}
19 changes: 19 additions & 0 deletions lua/keybindings/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
vim.g.mapleader = ' '
local map = vim.api.nvim_set_keymap
map('n', '<C-h>', '<C-w>h', {noremap = true, silent = false})
map('n', '<C-l>', '<C-w>l', {noremap = true, silent = false})
map('n', '<C-j>', '<C-w>j', {noremap = true, silent = false})
map('n', '<C-k>', '<C-w>k', {noremap = true, silent = false})

map('i', 'jk', '<ESC>', {noremap = true, silent = false})
map('i', 'kj', '<ESC>', {noremap = true, silent = false})

map('n', '<leader>e', ':NvimTreeToggle<CR>', {noremap = true, silent = true})

map('v', '<', '<gv', {noremap = true, silent = false})
map('v', '>', '>gv', {noremap = true, silent = false})

map("n", "<C-u>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<cr>",
{noremap = true, silent = true})
map("n", "<C-d>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<cr>",
{noremap = true, silent = true})
65 changes: 65 additions & 0 deletions lua/lsp/cmp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
vim.g.completeopt = "menu,menuone,noselect,noinsert"
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s")
== nil
end

local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end
-- Setup nvim-cmp.
local cmp = require 'cmp'
local lspkind = require('lspkind')

cmp.setup({
snippet = {
expand = function(args)
-- For `vsnip` user.
vim.fn["vsnip#anonymous"](args.body)

-- For `luasnip` user.
-- require('luasnip').lsp_expand(args.body)

-- For `ultisnips` user.
-- vim.fn["UltiSnips#Anon"](args.body)
end
},
mapping = {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({select = true}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif vim.fn["vsnip#available"]() == 1 then
feedkey("<Plug>(vsnip-expand-or-jump)", "")
elseif has_words_before() then
cmp.complete()
else
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
end
end, {"i", "s"}),

["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
elseif vim.fn["vsnip#jumpable"](-1) == 1 then
feedkey("<Plug>(vsnip-jump-prev)", "")
end
end, {"i", "s"})
},
sources = {
{name = 'nvim_lsp'}, -- For vsnip user.
{name = 'vsnip'}, -- For luasnip user.
-- { name = 'luasnip' },
-- For ultisnips user.
-- { name = 'ultisnips' },
{name = 'buffer'}
},
formatting = {format = lspkind.cmp_format({with_text = true, maxwidth = 50})}
})

6 changes: 6 additions & 0 deletions lua/lsp/diagnostic_signs.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local signs = {Error = "", Warn = "", Hint = "", Info = ""}

for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = ""})
end
3 changes: 3 additions & 0 deletions lua/lsp/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('lsp/cmp')
require('lsp/diagnostic_signs')
require('lsp/language_servers')
21 changes: 21 additions & 0 deletions lua/lsp/language_servers.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local lsp_installer = require('nvim-lsp-installer')

lsp_installer.on_server_ready(function(server)
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol
.make_client_capabilities())
local opts = {capabilities = capabilities}
if server.name == "sumneko_lua" then
opts = vim.tbl_deep_extend("force", {
settings = {
Lua = {
runtime = {version = 'LuaJIT', path = vim.split(package.path, ';')},
diagnostics = {globals = {'vim'}},
workspace = {library = vim.api.nvim_get_runtime_file("", true), checkThirdParty = false},
telemetry = {enable = false}
}
}

}, opts)
end
server:setup(opts)
end)
32 changes: 32 additions & 0 deletions lua/lspsaga-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local lspsaga = require 'lspsaga'
lspsaga.setup {
debug = false,
use_saga_diagnostic_sign = true,
-- diagnostic sign
error_sign = "",
warn_sign = "",
hint_sign = "",
infor_sign = "",
diagnostic_header_icon = "",
-- code action title icon
code_action_icon = "",
code_action_prompt = {enable = true, sign = true, sign_priority = 40, virtual_text = true},
finder_definition_icon = "",
finder_reference_icon = "",
max_preview_lines = 10,
finder_action_keys = {
open = "o",
vsplit = "s",
split = "i",
quit = "q",
scroll_down = "<C-f>",
scroll_up = "<C-b>"
},
code_action_keys = {quit = "q", exec = "<CR>"},
rename_action_keys = {quit = "<C-c>", exec = "<CR>"},
definition_preview_icon = "",
border_style = "single",
rename_prompt_prefix = "",
server_filetype_map = {},
diagnostic_prefix_format = "%d. "
}
28 changes: 28 additions & 0 deletions lua/null-ls-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local null_ls = require('null-ls')

local formatting = null_ls.builtins.formatting

null_ls.setup({
sources = {
formatting.prettier, formatting.black, formatting.gofmt, formatting.shfmt,
formatting.clang_format, formatting.cmake_format, formatting.dart_format,
formatting.lua_format.with({
extra_args = {
'--no-keep-simple-function-one-line', '--no-break-after-operator', '--column-limit=100',
'--break-after-table-lb', '--indent-width=2'
}
}), formatting.isort, formatting.codespell.with({filetypes = {'markdown'}})
},
on_attach = function(client)
if client.resolved_capabilities.document_formatting then
vim.cmd("autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_seq_sync()")
end
vim.cmd [[
augroup document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]]
end
})
5 changes: 5 additions & 0 deletions lua/nvim-tree-config/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim.g.nvim_tree_width = 25
require 'nvim-tree'.setup { auto_open = 1, gitignore = 1 }
vim.cmd [[
autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
]]
41 changes: 41 additions & 0 deletions lua/options/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local opt = vim.opt

vim.cmd('filetype plugin indent on')
vim.o.shortmess = vim.o.shortmess .. 'c'
vim.o.hidden = true
vim.o.whichwrap = 'b,s,<,>,[,],h,l'
vim.o.pumheight = 10
vim.o.fileencoding = 'utf-8'
vim.o.cmdheight = 2
vim.o.splitbelow = true
opt.iskeyword:append("-")
vim.o.splitright = true
vim.opt.termguicolors = true
vim.o.conceallevel = 0
vim.o.showtabline = 2
vim.o.showmode = false
vim.o.backup = false
vim.o.writebackup = false
vim.o.updatetime = 300
vim.o.timeoutlen = 100
vim.o.clipboard = "unnamedplus"
vim.o.hlsearch = false
vim.o.ignorecase = true
vim.o.scrolloff = 3
vim.o.sidescrolloff = 5
vim.o.mouse = "a"
vim.wo.wrap = false
opt.relativenumber = true
vim.wo.number = true
vim.o.cursorline = true
vim.wo.signcolumn = "yes"
opt.smartcase = true
vim.o.tabstop = 2
vim.bo.tabstop = 2
vim.o.softtabstop = 2
vim.o.shiftwidth = 2
vim.bo.shiftwidth = 2
vim.o.autoindent = true
vim.bo.autoindent = true
vim.o.expandtab = true
vim.bo.expandtab = true
83 changes: 83 additions & 0 deletions lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({
'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path
})
vim.api.nvim_command('packadd packer.nvim')
end

return require('packer').startup({
function(use)
-- Packer can manage itself
use {'wbthomason/packer.nvim'}
use {'nanozuki/tabby.nvim'}
use {'EdenEast/nightfox.nvim'}
use { 'rose-pine/neovim'}
use { 'nvim-treesitter/nvim-treesitter'}
use {
'tamton-aquib/staline.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
event = "BufRead",
config = "require('staline-config')"
}
use {
'akinsho/bufferline.nvim',
requires = 'kyazdani42/nvim-web-devicons',
event = "BufWinEnter",
config = "require('bufferline-config')"
}
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
cmd = "NvimTreeToggle",
config = "require('nvim-tree-config')"
}
use { 'windwp/nvim-ts-autotag', event = "InsertEnter", after = "nvim-treesitter" }
use { 'p00f/nvim-ts-rainbow', after = "nvim-treesitter" }
use { 'windwp/nvim-autopairs', config = "require('autopairs-config')", after = "nvim-cmp" }
use { 'folke/which-key.nvim', event = "BufWinEnter", config = "require('whichkey-config')" }
use {
'nvim-telescope/telescope.nvim',
requires = { { 'nvim-lua/plenary.nvim' } },
cmd = "Telescope",
config = "require('telescope-config')"
}
use { 'neovim/nvim-lspconfig', config = "require('lsp')" }
use { 'hrsh7th/cmp-nvim-lsp' }
use { 'hrsh7th/cmp-buffer' }
use { 'hrsh7th/nvim-cmp' }
use { 'hrsh7th/cmp-vsnip' }
use { 'hrsh7th/vim-vsnip' }
use { 'onsails/lspkind-nvim' }
use { 'norcalli/nvim-colorizer.lua', config = "require('colorizer-config')", event = "BufRead" }
use {
'lewis6991/gitsigns.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require('gitsigns').setup { current_line_blame = true }
end
}
use { 'glepnir/dashboard-nvim', event = "BufRead", config = "require('dashboard-config')" }
use {
"lukas-reineke/indent-blankline.nvim",
config = "require('blankline-config')",
event = "BufRead"
}
use { "akinsho/toggleterm.nvim", config = "require('toggleterm-config')" }
use { "terrortylor/nvim-comment", config = "require('comment-config')" }
use { 'tami5/lspsaga.nvim', config = "require('lspsaga-config')" }
use { 'williamboman/nvim-lsp-installer' }
use { 'jose-elias-alvarez/null-ls.nvim', config = "require('null-ls-config')" }
use { "folke/zen-mode.nvim", config = 'require("zen-mode-config")' }
use { "folke/twilight.nvim", config = "require('twilight-config')" }
use { 'andweeb/presence.nvim', config = "require('presence-config')" }
end,
config = {
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
}
})
Loading

0 comments on commit 09a59f0

Please sign in to comment.