added changes for work
This commit is contained in:
parent
d350db2449
commit
5627b65878
138
init.lua
138
init.lua
|
@ -1,3 +1,8 @@
|
|||
if vim.g.vscode then
|
||||
-- VSCode Neovim-specific config
|
||||
else
|
||||
-- Full Neovim (GUI or terminal) config
|
||||
|
||||
--[[
|
||||
|
||||
=====================================================================
|
||||
|
@ -91,18 +96,19 @@ vim.g.mapleader = ' '
|
|||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- 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 ]]
|
||||
-- See `:help vim.opt`
|
||||
-- NOTE: You can change these options as you wish!
|
||||
-- For more options, you can see `:help option-list`
|
||||
|
||||
local leet_arg = 'leetcode.nvim'
|
||||
-- Make line numbers default
|
||||
vim.opt.number = true
|
||||
-- You can also add relative line numbers, to help with jumping.
|
||||
-- Experiment for yourself to see if you like it!
|
||||
-- vim.opt.relativenumber = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.opt.mouse = 'a'
|
||||
|
@ -275,7 +281,19 @@ require('lazy').setup({
|
|||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'glacambre/firenvim',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end, -- Only load when not loaded through vscode},
|
||||
build = ':call firenvim#install(0)',
|
||||
},
|
||||
{
|
||||
'sbdchd/neoformat',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end, -- Only load when not loaded through vscode},
|
||||
},
|
||||
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
|
||||
--
|
||||
-- This is often very useful to both group configuration, as well as handle
|
||||
|
@ -350,74 +368,59 @@ require('lazy').setup({
|
|||
--
|
||||
-- Use the `dependencies` key to specify the dependencies of a particular plugin
|
||||
|
||||
{ -- Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
event = 'VimEnter',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
|
||||
-- `build` is used to run some command when the plugin is installed/updated.
|
||||
-- This is only run then, not every time Neovim starts up.
|
||||
build = 'make',
|
||||
|
||||
-- `cond` is a condition used to determine whether this plugin should be
|
||||
-- installed and loaded.
|
||||
cond = function()
|
||||
return vim.fn.executable 'make' == 1
|
||||
end,
|
||||
},
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||
|
||||
-- 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,
|
||||
},
|
||||
{
|
||||
'kawre/leetcode.nvim',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end,
|
||||
lazy = leet_arg ~= vim.fn.argv(0, -1),
|
||||
opts = { arg = leet_arg },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
||||
-- it can fuzzy find! It's more than just a "file finder", it can search
|
||||
-- many different aspects of Neovim, your workspace, LSP, and more!
|
||||
--
|
||||
-- The easiest way to use Telescope, is to start by doing something like:
|
||||
-- :Telescope help_tags
|
||||
--
|
||||
-- After running this command, a window will open up and you're able to
|
||||
-- type in the prompt window. You'll see a list of `help_tags` options and
|
||||
-- a corresponding preview of the help.
|
||||
--
|
||||
-- Two important keymaps to use while in Telescope are:
|
||||
-- - Insert mode: <c-/>
|
||||
-- - Normal mode: ?
|
||||
--
|
||||
-- This opens a window that shows you all of the keymaps for the current
|
||||
-- Telescope picker. This is really useful to discover what Telescope can
|
||||
-- do as well as how to actually do it!
|
||||
if vim.g.vscode then
|
||||
return
|
||||
end
|
||||
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require('telescope').setup {
|
||||
-- You can put your default mappings / updates / etc. in here
|
||||
-- All the info you're looking for is in `:help telescope.setup()`
|
||||
--
|
||||
-- defaults = {
|
||||
-- mappings = {
|
||||
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
||||
-- },
|
||||
-- },
|
||||
-- pickers = {}
|
||||
local ok, telescope = pcall(require, 'telescope')
|
||||
if not ok then
|
||||
return
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown(),
|
||||
},
|
||||
['ui-select'] = require('telescope.themes').get_dropdown(),
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable Telescope extensions if they are installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
pcall(require('telescope').load_extension, 'ui-select')
|
||||
pcall(telescope.load_extension, 'fzf')
|
||||
pcall(telescope.load_extension, 'ui-select')
|
||||
|
||||
local ok_builtin, builtin = pcall(require, 'telescope.builtin')
|
||||
if not ok_builtin then
|
||||
return
|
||||
end
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local builtin = require 'telescope.builtin'
|
||||
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
||||
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
||||
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
||||
|
@ -467,9 +470,21 @@ require('lazy').setup({
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'github/copilot.vim',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end,
|
||||
enabled = true,
|
||||
cmd = 'Copilot',
|
||||
event = 'InsertEnter',
|
||||
},
|
||||
{
|
||||
-- Main LSP Configuration
|
||||
'neovim/nvim-lspconfig',
|
||||
cond = function()
|
||||
return not vim.g.vscode
|
||||
end,
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||
|
@ -673,7 +688,7 @@ require('lazy').setup({
|
|||
-- https://github.com/pmizio/typescript-tools.nvim
|
||||
--
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
ts_ls = {},
|
||||
--
|
||||
|
||||
lua_ls = {
|
||||
|
@ -764,7 +779,7 @@ require('lazy').setup({
|
|||
-- python = { "isort", "black" },
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -802,6 +817,10 @@ require('lazy').setup({
|
|||
},
|
||||
'folke/lazydev.nvim',
|
||||
},
|
||||
{
|
||||
'sphamba/smear-cursor.nvim',
|
||||
opts = {},
|
||||
},
|
||||
--- @module 'blink.cmp'
|
||||
--- @type blink.cmp.Config
|
||||
opts = {
|
||||
|
@ -966,11 +985,11 @@ require('lazy').setup({
|
|||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug',
|
||||
-- require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
-- require 'kickstart.plugins.neo-tree',
|
||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
require 'kickstart.plugins.indent_line',
|
||||
require 'kickstart.plugins.lint',
|
||||
require 'kickstart.plugins.autopairs',
|
||||
require 'kickstart.plugins.neo-tree',
|
||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- This is the easiest way to modularize your config.
|
||||
|
@ -1006,3 +1025,4 @@ require('lazy').setup({
|
|||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue