First Commit

This commit is contained in:
Norm Rasmussen
2022-03-03 13:52:43 -05:00
commit 1f66ee24e0
33 changed files with 1656 additions and 0 deletions

View File

@ -0,0 +1,48 @@
-----------------------------------------------------------
-- Dashboard configuration file
-----------------------------------------------------------
-- Plugin: alpha-nvim
-- url: https://github.com/goolord/alpha-nvim
-- For configuration examples see: https://github.com/goolord/alpha-nvim/discussions/16
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.dashboard'
-- Footer
local function footer()
local version = vim.version()
local print_version = "v" .. version.major .. '.' .. version.minor .. '.' .. version.patch
local datetime = os.date('%Y/%m/%d %H:%M:%S')
return print_version .. ' ' .. datetime
end
-- Banner
local banner = {
" ",
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
" ",
}
dashboard.section.header.val = banner
-- Menu
dashboard.section.buttons.val = {
dashboard.button('e', ' New file', ':ene <BAR> startinsert<CR>'),
dashboard.button('f', ' Find file', ':NvimTreeOpen<CR>'),
dashboard.button('s', ' Settings', ':e $MYVIMRC<CR>'),
dashboard.button('u', ' Update plugins', ':PackerUpdate<CR>'),
dashboard.button('q', ' Quit', ':qa<CR>'),
}
dashboard.section.footer.val = footer()
alpha.setup(dashboard.config)

257
lua/plugins/feline.lua Normal file
View File

@ -0,0 +1,257 @@
----------------------------------------------------------
-- Statusline configuration file
-----------------------------------------------------------
-- Plugin: feline.nvim
-- url: https://github.com/famiu/feline.nvim
--- For the configuration see the Usage section:
--- https://github.com/famiu/feline.nvim/blob/master/USAGE.md
--- Thanks to ibhagwan for the example to follow:
--- https://github.com/ibhagwan/nvim-lua
local colors = require('colors').monokai
local vi_mode_colors = {
NORMAL = colors.cyan,
INSERT = colors.green,
VISUAL = colors.yellow,
OP = colors.cyan,
BLOCK = colors.cyan,
REPLACE = colors.red,
['V-REPLACE'] = colors.red,
ENTER = colors.orange,
MORE = colors.orange,
SELECT = colors.yellow,
COMMAND = colors.pink,
SHELL = colors.pink,
TERM = colors.pink,
NONE = colors.purple
}
-- Providers (LSP, vi_mode)
local lsp = require 'feline.providers.lsp'
local vi_mode_utils = require 'feline.providers.vi_mode'
-- LSP diagnostic
local lsp_get_diag = function(str)
local count = vim.lsp,diagnostic.get_count(0, str)
return (count > 0) and ' '..count..' ' or ''
end
-- My components
local comps = {
-- vi_mode -> NORMAL, INSERT..
vi_mode = {
left = {
provider = function()
local label = ' '..vi_mode_utils.get_vim_mode()..' '
return label
end,
hl = function()
local set_color = {
name = vi_mode_utils.get_mode_highlight_name(),
fg = colors.bg,
bg = vi_mode_utils.get_mode_color(),
style = 'bold',
}
return set_color
end,
left_sep = ' ',
right_sep = ' ',
}
},
-- Parse file information:
file = {
-- File name
info = {
provider = {
name = 'file_info',
opts = {
type = 'relative',
file_modified_icon = '',
}
},
hl = { fg = colors.cyan },
icon = '',
},
-- File type
type = {
provider = function()
local type = vim.bo.filetype:lower()
local extension = vim.fn.expand '%:e'
local icon = require('nvim-web-devicons').get_icon(extension)
if icon == nil then
icon = ''
end
return ' ' .. icon .. ' ' .. type
end,
hl = { fg = colors.fg },
left_sep = ' ',
righ_sep = ' ',
},
-- Operating system
os = {
provider = function()
local os = vim.bo.fileformat:lower()
local icon
if os == 'unix' then
icon = ''
elseif os == 'mac' then
icon = ''
else
icon = ''
end
return icon .. os
end,
hl = { fg = colors.fg },
--left_sep = ' ',
right_sep = ' ',
},
-- Line-column
position = {
provider = { name = 'position' },
hl = {
fg = colors.fg,
style = 'bold',
},
left_sep = ' ',
right_sep = ' ',
},
-- Cursor position in %
line_percentage = {
provider = { name = 'line_percentage' },
hl = {
fg = colors.cyan,
style = 'bold',
},
left_sep = ' ',
right_sep = ' ',
},
-- Simple scrollbar
scroll_bar = {
provider = { name = 'scroll_bar' },
hl = { fg = colors.fg },
left_sep = ' ',
right_sep = ' ',
},
},
-- LSP info
diagnos = {
err = {
provider = 'diagnostic_errors',
icon = '',
hl = { fg = colors.red },
left_sep = ' ',
},
warn = {
provider = 'diagnostic_warnings',
icon = '',
hl = { fg = colors.yellow },
left_sep = ' ',
},
info = {
provider = 'diagnostic_info',
icon = '',
hl = { fg = colors.green },
left_sep = ' ',
},
hint = {
provider = 'diagnostic_hints',
icon = '',
hl = { fg = colors.cyan },
left_sep = ' ',
},
},
lsp = {
name = {
provider = 'lsp_client_names',
icon = '',
hl = { fg = colors.pink },
left_sep = ' ',
right_sep = ' ',
}
},
-- git info
git = {
branch = {
provider = 'git_branch',
icon = '',
hl = { fg = colors.pink },
left_sep = ' ',
},
add = {
provider = 'git_diff_added',
icon = '',
hl = { fg = colors.green },
left_sep = ' ',
},
change = {
provider = 'git_diff_changed',
icon = '',
hl = { fg = colors.orange },
left_sep = ' ',
},
remove = {
provider = 'git_diff_removed',
icon = '',
hl = { fg = colors.red },
left_sep = ' ',
}
}
}
-- Get active/inactive components
--- see: https://github.com/famiu/feline.nvim/blob/master/USAGE.md#components
local components = {
active = {},
inactive = {},
}
table.insert(components.active, {})
table.insert(components.active, {})
table.insert(components.inactive, {})
table.insert(components.inactive, {})
-- Right section
table.insert(components.active[1], comps.vi_mode.left)
table.insert(components.active[1], comps.file.info)
table.insert(components.active[1], comps.git.branch)
table.insert(components.active[1], comps.git.add)
table.insert(components.active[1], comps.git.change)
table.insert(components.active[1], comps.git.remove)
table.insert(components.inactive[1], comps.file.info)
-- Left Section
table.insert(components.active[2], comps.diagnos.err)
table.insert(components.active[2], comps.diagnos.warn)
table.insert(components.active[2], comps.diagnos.hint)
table.insert(components.active[2], comps.diagnos.info)
table.insert(components.active[2], comps.lsp.name)
table.insert(components.active[2], comps.file.type)
table.insert(components.active[2], comps.file.os)
table.insert(components.active[2], comps.file.position)
table.insert(components.active[2], comps.file.line_percentage)
-- Call feline
require('feline').setup {
theme = {
bg = colors.bg,
fg = colors.fg,
},
components = components,
vi_mode_colors = vi_mode_colors,
force_inactive = {
filetypes = {
'^NvimTree$',
'^packer$',
'^vista$',
'^help$',
},
buftypes = {
'^terminal$'
},
bufnames = {},
},
}

83
lua/plugins/gitsigns.lua Normal file
View File

@ -0,0 +1,83 @@
local M = {}
local opts = {
set = {
signs = {
add = {
hl = "GitSignsAdd",
text = "",
numhl = "GitSignsAddNr",
linehl = "GitSignsAddLn",
},
change = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
delete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
topdelete = {
hl = "GitSignsDelete",
text = "",
numhl = "GitSignsDeleteNr",
linehl = "GitSignsDeleteLn",
},
changedelete = {
hl = "GitSignsChange",
text = "",
numhl = "GitSignsChangeNr",
linehl = "GitSignsChangeLn",
},
},
numhl = false,
linehl = false,
keymaps = {
-- Default keymap options
noremap = true,
buffer = true,
},
signcolumn = true,
word_diff = false,
attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
},
current_line_blame_formatter_opts = {
relative_time = false,
},
max_file_length = 40000,
preview_config = {
-- Options passed to nvim_open_win
border = "rounded",
style = "minimal",
relative = "cursor",
row = 0,
col = 1,
},
watch_gitdir = {
interval = 1000,
follow_files = true,
},
sign_priority = 6,
update_debounce = 200,
status_formatter = nil, -- Use default
},
}
M.setup = function()
local gitsigns = require "gitsigns"
gitsigns.setup(opts.set)
end
return M

View File

@ -0,0 +1,25 @@
-----------------------------------------------------------
-- Indent line configuration file
-----------------------------------------------------------
-- Plugin: indent-blankline
-- url: https://github.com/lukas-reineke/indent-blankline.nvim
require('indent_blankline').setup {
char = "",
show_first_indent_level = false,
filetype_exclude = {
'help',
'git',
'markdown',
'text',
'terminal',
'lspinfo',
'packer',
},
buftype_exclude = {
'terminal',
'nofile',
},
}

68
lua/plugins/nvim-cmp.lua Normal file
View File

@ -0,0 +1,68 @@
-----------------------------------------------------------
-- Autocomplete configuration file
-----------------------------------------------------------
-- Plugin: nvim-cmp
-- url: https://github.com/hrsh7th/nvim-cmpa
local cmp = require 'cmp'
local luasnip = require 'luasnip'
cmp.setup {
-- Load snippet support
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
-- Completion settings
completion = {
--completeopt = 'menu,menuone,noselect'
keyword_length = 2
},
-- Key mapping
mapping = {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<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 {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
-- Tab mapping
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end,
['<S-Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end
},
-- Load sources, see: https://github.com/topics/nvim-cmp
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer' },
},
}

View File

@ -0,0 +1,11 @@
local lsp_installer = require("nvim-lsp-installer")
lsp_installer.settings({
ui = {
icons = {
server_installed = "",
server_pending = "",
server_uninstalled = ""
}
}
})

View File

@ -0,0 +1,109 @@
-----------------------------------------------------------
-- Neovim LSP configuration file
-----------------------------------------------------------
-- Plugin: nvim-lspconfig
-- url: https://github.com/neovim/nvim-lspconfig
local nvim_lsp = require 'lspconfig'
-- Add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' }
capabilities.textDocument.completion.completionItem.snippetSupport = true
capabilities.textDocument.completion.completionItem.preselectSupport = true
capabilities.textDocument.completion.completionItem.insertReplaceSupport = true
capabilities.textDocument.completion.completionItem.labelDetailsSupport = true
capabilities.textDocument.completion.completionItem.deprecatedSupport = true
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
capabilities.textDocument.completion.completionItem.resolveSupport = {
properties = {
'documentation',
'detail',
'additionalTextEdits',
},
}
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- Enable completion triggered by <c-x><c-o>
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = { noremap=true, silent=true }
-- See `:help vim.lsp.*` for documentation on any of the below functions
buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
buf_set_keymap('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
buf_set_keymap('n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
buf_set_keymap('n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
--[[
Language servers:
Add your language server to `servers`
For language servers list see:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
Bash --> bashls
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#bashls
Python --> pyright
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#pyright
C-C++ --> clangd
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#clangd
HTML/CSS/JSON --> vscode-html-languageserver
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#html
JavaScript/TypeScript --> tsserver
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#tsserver
--]]
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
local servers = { 'bashls', 'pyright', 'pylsp', 'clangd', 'html', 'tsserver', 'grammarly', 'dockerls', 'css', 'cssmodules_ls', 'arduino_language_server', 'pyre', 'gopls', 'theme_check' }
-- Set settings for language servers:
-- tsserver settings
local ts_settings = function(client)
client.resolved_capabilities.document_formatting = false
ts_settings(client)
end
-- Call setup
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
ts_settings = ts_settings,
flags = {
debounce_text_changes = 150,
}
}
end

48
lua/plugins/nvim-tree.lua Normal file
View File

@ -0,0 +1,48 @@
-----------------------------------------------------------
-- File manager configuration file
-----------------------------------------------------------
-- Plugin: nvim-tree
-- url: https://github.com/kyazdani42/nvim-tree.lua
--- Keybindings are defined in `keymapping.lua`:
--- https://github.com/kyazdani42/nvim-tree.lua#keybindings
--- Note: options under the g: command should be set BEFORE running the
--- setup function: https://github.com/kyazdani42/nvim-tree.lua#setup
--- See: `help NvimTree`
local g = vim.g
g.nvim_tree_quit_on_open = 0
g.nvim_tree_indent_markers = 1
g.nvim_tree_git_hl = 1
g.nvim_tree_highlight_opened_files = 1
g.nvim_tree_disable_window_picker = 1
g.nvim_tree_respect_buf_cwd = 1
g.nvim_tree_width_allow_resize = 1
g.nvim_tree_show_icons = {
git = 1,
folders = 1,
files = 1
}
g.nvim_tree_icons = {
default = ""
}
require('nvim-tree').setup {
open_on_setup = true,
update_cwd = true,
filters = {
dotfiles = true,
custom = { '.git', 'node_modules', '.cache', '.bin' },
},
git = {
enable = true,
ignore = true,
},
view = {
width = 32,
auto_resize = true
},
}

View File

@ -0,0 +1,15 @@
-----------------------------------------------------------
-- Treesitter configuration file
----------------------------------------------------------
-- Plugin: nvim-treesitter
-- url: https://github.com/nvim-treesitter/nvim-treesitter
require('nvim-treesitter.configs').setup {
highlight = {
enable = true,
},
}

67
lua/plugins/plugins.lua Executable file
View File

@ -0,0 +1,67 @@
local cmd = vim.cmd
cmd [[packadd packer.nvim]]
return require'packer'.startup(function()
use 'wbthomason/packer.nvim'
use 'wakatime/vim-wakatime'
use 'kyazdani42/nvim-tree.lua'
use 'nvim-treesitter/nvim-treesitter'
use 'sheerun/vim-polyglot'
use 'tjdevries/colorbuddy.nvim'
use 'bkegley/gloombuddy'
use {'prettier/vim-prettier', run = 'yarn install' }
use 'lukas-reineke/indent-blankline.nvim'
use 'simrat39/symbols-outline.nvim'
use 'kyazdani42/nvim-web-devicons'
use 'liuchengxu/vista.vim'
use 'nvim-lua/plenary.nvim'
use 'nvim-lua/popup.nvim'
use 'tanvirtin/monokai.nvim'
use 'lunarvim/colorschemes'
use 'christoomey/vim-tmux-navigator'
use { 'rose-pine/neovim', as = 'rose-pine' }
use 'folke/tokyonight.nvim'
use 'williamboman/nvim-lsp-installer'
use 'neovim/nvim-lspconfig'
use {
'famiu/feline.nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
}
use {
'lewis6991/gitsigns.nvim',
requires = { 'nvim-lua/plenary.nvim' },
config = function()
require('gitsigns').setup()
end
}
use {
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
}
use {
"nvim-telescope/telescope.nvim",
requires = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require "plugins/telescope"
end,
}
use {
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end
}
use {
'hrsh7th/nvim-cmp',
requires = {
'L3MON4D3/LuaSnip',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'saadparwaiz1/cmp_luasnip',
},
}
end)

View File

@ -0,0 +1,59 @@
local M = {}
M.setup = function ()
vim.g.symbols_outline = {
highlight_hovered_item = true,
show_guides = true,
auto_preview = true,
position = "right",
relative_width = true,
width = 20,
auto_close = false,
show_numbers = true,
show_relative_numbers = false,
show_symbol_details = true,
preview_bg_highlight = "Pmenu",
keymaps = {
close = { "<Esc>", "q" },
goto_location = "<Cr>",
focus_location = "o",
hover_symbol = "<C-space>",
toggle_preview = "K",
rename_symbol = "r",
code_actions = "a",
},
lsp_blacklist = {},
symbol_blacklist = {},
symbols = {
File = { icon = "", hl = "TSURI" },
Module = { icon = "", hl = "TSNamespace" },
Namespace = { icon = "", hl = "TSNamespace" },
Package = { icon = "", hl = "TSNamespace" },
Class = { icon = "𝓒", hl = "TSType" },
Method = { icon = "ƒ", hl = "TSMethod" },
Property = { icon = "", hl = "TSMethod" },
Field = { icon = "", hl = "TSField" },
Constructor = { icon = "", hl = "TSConstructor" },
Enum = { icon = "", hl = "TSType" },
Interface = { icon = "", hl = "TSType" },
Function = { icon = "", hl = "TSFunction" },
Variable = { icon = "", hl = "TSConstant" },
Constant = { icon = "", hl = "TSConstant" },
String = { icon = "𝓐", hl = "TSString" },
Number = { icon = "#", hl = "TSNumber" },
Boolean = { icon = "", hl = "TSBoolean" },
Array = { icon = "", hl = "TSConstant" },
Object = { icon = "", hl = "TSType" },
Key = { icon = "🔐", hl = "TSType" },
Null = { icon = "NULL", hl = "TSType" },
EnumMember = { icon = "", hl = "TSField" },
Struct = { icon = "𝓢", hl = "TSType" },
Event = { icon = "", hl = "TSType" },
Operator = { icon = "+", hl = "TSOperator" },
TypeParameter = { icon = "𝙏", hl = "TSParameter" },
},
}
end
return M

104
lua/plugins/telescope.lua Normal file
View File

@ -0,0 +1,104 @@
local actions = require "telescope.actions"
local M = {}
M.project_files = function()
local opts = {} -- define here if you want to define something
local ok = pcall(require("telescope.builtin").git_files, opts)
if not ok then
require("telescope.builtin").find_files(opts)
end
end
require("telescope").setup {
defaults = {
prompt_prefix = "/ ",
selection_caret = "",
color_devicons = false,
mappings = {
i = {
["<Esc>"] = actions.close,
["<C-n>"] = actions.move_selection_next,
["<C-p>"] = actions.move_selection_previous,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-c>"] = actions.close,
["<Down>"] = false,
["<Up>"] = false,
["<CR>"] = actions.select_default + actions.center,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
},
n = {
["<Esc>"] = actions.close,
["<CR>"] = actions.select_default + actions.center,
["<C-x>"] = actions.select_horizontal,
["<C-v>"] = actions.select_vertical,
["j"] = actions.move_selection_next,
["k"] = actions.move_selection_previous,
["<Down>"] = false,
["<Up>"] = false,
["<C-u>"] = actions.preview_scrolling_up,
["<C-d>"] = actions.preview_scrolling_down,
},
},
file_ignore_patterns = {
".git/*",
"node_modules/*",
"bower_components/*",
".svn/*",
".hg/*",
"CVS/*",
".next/*",
".docz/*",
".DS_Store",
},
layout_strategy = "flex",
scroll_strategy = "cycle",
},
pickers = {
find_files = {
theme = "ivy",
},
git_files = {
theme = "ivy",
},
live_grep = {
theme = "ivy",
previewer = false,
},
file_browser = {
theme = "ivy",
previewer = false,
},
},
}
vim.api.nvim_set_keymap(
"n",
"<C-p>",
'<cmd>lua require("plugins/telescope").project_files()<CR>',
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
"n",
"<Leader>g",
'<cmd>lua require("telescope.builtin").live_grep()<CR>',
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
"n",
"<Leader>f",
'<cmd>lua require("telescope.builtin").file_browser()<CR>',
{ noremap = true, silent = true }
)
vim.api.nvim_set_keymap(
"n",
"<Leader>b",
'<cmd>lua require("telescope.builtin").buffers()<CR>',
{ noremap = true, silent = true }
)
return M

37
lua/plugins/vista.lua Normal file
View File

@ -0,0 +1,37 @@
----------------------------------------------------------
-- Vista (tagbar) configuration file
-----------------------------------------------------------
-- Plugin: vista.vim
-- url: https://github.com/liuchengxu/vista.vim
local g = vim.g
local cmd = vim.cmd
-- How each level is indented and what to prepend.
--- This could make the display more compact or more spacious.
--- e.g., more compact: ["▸ ", ""]
--- Note: this option only works for the kind renderer, not the tree renderer
g.vista_icon_indent = '["╰─▸ ", "├─▸ "]'
-- Executive used when opening vista sidebar without specifying it.
--- See all the avaliable executives via `:echo g:vista#executives`.
g.vista_default_executive = 'ctags'
-- Ensure you have installed some decent font to show these pretty symbols,
--- then you can enable icon for the kind.
cmd [[let g:vista#renderer#enable_icon = 1]]
-- Change some default icons
--- see: https://github.com/slavfox/Cozette/blob/master/img/charmap.txt
cmd [[
let g:vista#renderer#icons = {
\ "function": "\u0192",
\ "variable": "\uf00d",
\ "prototype": "\uf013",
\ "macro": "\uf00b",
\ }
]]