Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33eee9a

Browse files
committed
feat: initial commit from video.
0 parents  commit 33eee9a

File tree

13 files changed

+456
-0
lines changed

13 files changed

+456
-0
lines changed

after/plugin/colors.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
function ColorMyPencils(color)
3+
color = color or "rose-pine"
4+
vim.cmd.colorscheme(color)
5+
6+
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
7+
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
8+
9+
end
10+
11+
ColorMyPencils()

after/plugin/fugitive.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vim.keymap.set("n", "<leader>gs", vim.cmd.Git);
2+

after/plugin/harpoon.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
local mark = require("harpoon.mark")
2+
local ui = require("harpoon.ui")
3+
4+
vim.keymap.set("n", "<leader>a", mark.add_file)
5+
vim.keymap.set("n", "<C-e>", ui.toggle_quick_menu)
6+
7+
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end)
8+
vim.keymap.set("n", "<C-t>", function() ui.nav_file(2) end)
9+
vim.keymap.set("n", "<C-n>", function() ui.nav_file(3) end)
10+
vim.keymap.set("n", "<C-s>", function() ui.nav_file(4) end)
11+
12+

after/plugin/lsp.lua

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
local lsp = require("lsp-zero")
2+
3+
lsp.preset("recommended")
4+
5+
lsp.ensure_installed({
6+
'tsserver',
7+
'eslint',
8+
'sumneko_lua',
9+
'rust_analyzer',
10+
})
11+
12+
local cmp = require('cmp')
13+
local cmp_select = {behavior = cmp.SelectBehavior.Select}
14+
local cmp_mappings = lsp.defaults.cmp_mappings({
15+
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
16+
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
17+
['<C-y>'] = cmp.mapping.confirm({ select = true }),
18+
["<C-Space>"] = cmp.mapping.complete(),
19+
})
20+
21+
lsp.set_preferences({
22+
sign_icons = { }
23+
})
24+
25+
lsp.setup_nvim_cmp({
26+
mapping = cmp_mappings
27+
})
28+
29+
lsp.on_attach(function(client, bufnr)
30+
local opts = {buffer = bufnr, remap = false}
31+
32+
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
33+
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
34+
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
35+
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
36+
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
37+
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
38+
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
39+
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
40+
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
41+
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
42+
end)
43+
44+
lsp.setup()
45+
46+

after/plugin/telescope.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
local builtin = require('telescope.builtin')
2+
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
3+
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
4+
vim.keymap.set('n', '<leader>ps', function()
5+
builtin.grep_string({ search = vim.fn.input("Grep > ") });
6+
end)
7+

after/plugin/treesitter.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require'nvim-treesitter.configs'.setup {
2+
-- A list of parser names, or "all"
3+
ensure_installed = { "help", "javascript", "typescript", "c", "lua", "rust" },
4+
5+
-- Install parsers synchronously (only applied to `ensure_installed`)
6+
sync_install = false,
7+
8+
-- Automatically install missing parsers when entering buffer
9+
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
10+
auto_install = true,
11+
12+
highlight = {
13+
-- `false` will disable the whole extension
14+
enable = true,
15+
16+
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
17+
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
18+
-- Using this option may slow down your editor, and you may see some duplicate highlights.
19+
-- Instead of true it can also be a list of languages
20+
additional_vim_regex_highlighting = false,
21+
},
22+
}
23+

after/plugin/undotree.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
2+

init.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require("theprimeagen")
2+

lua/theprimeagen/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require("theprimeagen.set")
2+
require("theprimeagen.remap")
3+
4+
5+
6+
7+
8+
9+
10+

lua/theprimeagen/packer.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
2+
3+
-- Only required if you have packer configured as `opt`
4+
vim.cmd [[packadd packer.nvim]]
5+
6+
return require('packer').startup(function(use)
7+
-- Packer can manage itself
8+
use 'wbthomason/packer.nvim'
9+
10+
use {
11+
'nvim-telescope/telescope.nvim', tag = '0.1.0',
12+
-- or , branch = '0.1.x',
13+
requires = { {'nvim-lua/plenary.nvim'} }
14+
}
15+
16+
use({
17+
'rose-pine/neovim',
18+
as = 'rose-pine',
19+
config = function()
20+
vim.cmd('colorscheme rose-pine')
21+
end
22+
})
23+
24+
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
25+
use('nvim-treesitter/playground')
26+
use('theprimeagen/harpoon')
27+
use('mbbill/undotree')
28+
use('tpope/vim-fugitive')
29+
30+
use {
31+
'VonHeikemen/lsp-zero.nvim',
32+
requires = {
33+
-- LSP Support
34+
{'neovim/nvim-lspconfig'},
35+
{'williamboman/mason.nvim'},
36+
{'williamboman/mason-lspconfig.nvim'},
37+
38+
-- Autocompletion
39+
{'hrsh7th/nvim-cmp'},
40+
{'hrsh7th/cmp-buffer'},
41+
{'hrsh7th/cmp-path'},
42+
{'saadparwaiz1/cmp_luasnip'},
43+
{'hrsh7th/cmp-nvim-lsp'},
44+
{'hrsh7th/cmp-nvim-lua'},
45+
46+
-- Snippets
47+
{'L3MON4D3/LuaSnip'},
48+
{'rafamadriz/friendly-snippets'},
49+
}
50+
}
51+
52+
end)
53+

0 commit comments

Comments
 (0)