Compare commits
8 Commits
a3d16cbff2
...
f796d0775e
Author | SHA1 | Date | |
---|---|---|---|
f796d0775e | |||
ffb20ec8a4 | |||
1734908df0 | |||
01d09bc9c0 | |||
4324070cac | |||
ebdb4420b6 | |||
171c63a070 | |||
46a53b7c38 |
@ -38,7 +38,9 @@ local lsp_symbols = {
|
||||
TypeParameter = " (TypeParameter)",
|
||||
}
|
||||
|
||||
local cmp = require'cmp'
|
||||
local status, cmp = pcall(require, "cmp")
|
||||
if (not status) then return end
|
||||
|
||||
cmp.setup{
|
||||
completion = {
|
||||
completeopt = 'menuone,noinsert,noselect',
|
||||
|
@ -1,9 +1,8 @@
|
||||
local autopairs_status_ok, autopairs = pcall(require, "nvim-autopairs")
|
||||
if not autopairs_status_ok then
|
||||
return
|
||||
end
|
||||
local status, autopairs = pcall(require, "nvim-autopairs")
|
||||
if (not status) then return end
|
||||
|
||||
autopairs.setup{
|
||||
disable_filetype = { "TelescopePrompt" , "vim" },
|
||||
ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]],"%s+", ""),
|
||||
}
|
||||
|
||||
|
1
nvim/.config/nvim/lua/config/gitsigns.lua
Normal file
1
nvim/.config/nvim/lua/config/gitsigns.lua
Normal file
@ -0,0 +1 @@
|
||||
require('gitsigns').setup {}
|
@ -1,3 +1,7 @@
|
||||
local status, telescope = pcall(require, "telescope")
|
||||
if (not status) then return end
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
local previewers = require('telescope.previewers')
|
||||
local Job = require('plenary.job')
|
||||
local new_maker = function(filepath, bufnr, opts)
|
||||
@ -19,10 +23,15 @@ local new_maker = function(filepath, bufnr, opts)
|
||||
}):sync()
|
||||
end
|
||||
|
||||
require('telescope').setup {
|
||||
local fb_actions = require "telescope".extensions.file_browser.actions
|
||||
local function telescope_buffer_dir()
|
||||
return vim.fn.expand('%:p:h')
|
||||
end
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
buffer_previewer_maker = new_maker,
|
||||
file_ignore_patterns = {"**/*.pdf"},
|
||||
file_ignore_patterns = { "**/*.pdf" },
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
@ -31,16 +40,52 @@ require('telescope').setup {
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
},
|
||||
file_browser = {
|
||||
theme = "dropdown",
|
||||
-- disables netrw and use telescope-file-browser in its place
|
||||
hijack_netrw = true,
|
||||
mappings = {
|
||||
["n"] = {
|
||||
-- your custom normal mode mappings
|
||||
["h"] = fb_actions.goto_parent_dir,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
require('telescope').load_extension('fzf')
|
||||
telescope.load_extension('fzf')
|
||||
telescope.load_extension('file_browser')
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
-- Find files using Telescope command-line sugar.
|
||||
map('n', '<leader>e', '<cmd>Telescope find_files<cr>', {})
|
||||
map('n', '<leader>g', '<cmd>Telescope live_grep<cr>', {})
|
||||
map('n', '<leader>b', '<cmd>Telescope buffers<cr>', {})
|
||||
map('n', '<leader>h', '<cmd>Telescope help_tags<cr>', {})
|
||||
|
||||
-- keymaps
|
||||
vim.keymap.set('n', '<leader>e',
|
||||
function()
|
||||
builtin.find_files({
|
||||
})
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>g', function()
|
||||
builtin.live_grep()
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>b', function()
|
||||
builtin.buffers()
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>h', function()
|
||||
builtin.resume()
|
||||
end)
|
||||
-- vim.keymap.set('n', '<leader>d', function()
|
||||
-- builtin.diagnostics()
|
||||
-- end)
|
||||
vim.keymap.set("n", "<leader>fb", function()
|
||||
telescope.extensions.file_browser.file_browser({
|
||||
path = "%:p:h",
|
||||
cwd = telescope_buffer_dir(),
|
||||
respect_gitignore = false,
|
||||
hidden = true,
|
||||
grouped = true,
|
||||
previewer = false,
|
||||
initial_mode = "normal",
|
||||
layout_config = { height = 40 }
|
||||
})
|
||||
end)
|
||||
|
@ -1,4 +1,7 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
local status, ts = pcall(require, "nvim-treesitter.configs")
|
||||
if (not status) then return end
|
||||
|
||||
ts.setup {
|
||||
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ensure_installed = {"python", "css", "html", "lua", "javascript", "vue", "c", "markdown", "rst"},
|
||||
highlight = {
|
||||
|
@ -56,7 +56,17 @@ end
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local servers = { "texlab", "pyright", "vuels", "tsserver", "html" }
|
||||
local servers = {
|
||||
"texlab",
|
||||
"pyright",
|
||||
"vuels",
|
||||
"tsserver",
|
||||
"html",
|
||||
"sumneko_lua",
|
||||
"ansiblels",
|
||||
"arduino_language_server",
|
||||
"clangd",
|
||||
}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
|
@ -50,7 +50,11 @@ return packer.startup(function(use)
|
||||
}
|
||||
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'mhinz/vim-signify'
|
||||
-- use 'mhinz/vim-signify'
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = [[require('config.gitsigns')]],
|
||||
}
|
||||
|
||||
use 'tpope/vim-surround'
|
||||
use 'tpope/vim-repeat'
|
||||
@ -72,10 +76,10 @@ return packer.startup(function(use)
|
||||
-- 'rafamadriz/friendly-snippets',
|
||||
},
|
||||
}
|
||||
use {'hrsh7th/cmp-vsnip', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
|
||||
use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'}
|
||||
use { 'hrsh7th/cmp-vsnip', after = 'nvim-cmp' }
|
||||
use { 'hrsh7th/cmp-buffer', after = 'nvim-cmp' }
|
||||
use { 'hrsh7th/cmp-path', after = 'nvim-cmp' }
|
||||
use { 'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp' }
|
||||
-- use {'f3fora/cmp-spell', after = 'nvim-cmp'}
|
||||
|
||||
-- for formatters and linters
|
||||
@ -89,10 +93,11 @@ return packer.startup(function(use)
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = [[require('config.telescope')]],
|
||||
requires = { 'nvim-lua/plenary.nvim'}
|
||||
requires = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
||||
|
||||
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||
use { "nvim-telescope/telescope-file-browser.nvim" }
|
||||
|
||||
use {
|
||||
'lervag/vimtex',
|
||||
@ -121,7 +126,7 @@ return packer.startup(function(use)
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
config=[[require('config.treesitter')]],
|
||||
config = [[require('config.treesitter')]],
|
||||
run = ':TSUpdate',
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@
|
||||
],
|
||||
"description": "tabular"
|
||||
},
|
||||
|
||||
"minipage": {
|
||||
"prefix": "minipage",
|
||||
"body": [
|
||||
@ -73,6 +74,7 @@
|
||||
],
|
||||
"description": "minipage"
|
||||
},
|
||||
|
||||
"multicols": {
|
||||
"prefix": "multicols",
|
||||
"body": [
|
||||
@ -82,6 +84,16 @@
|
||||
],
|
||||
"description": "multicols"
|
||||
},
|
||||
|
||||
"image": {
|
||||
"prefix": "image",
|
||||
"body": [
|
||||
"\\\\includegraphics[scale=${1:1}]{${2:./fig/}}",
|
||||
"$0"
|
||||
],
|
||||
"description": "exercise xsim"
|
||||
},
|
||||
|
||||
"exercise": {
|
||||
"prefix": "exercise",
|
||||
"body": [
|
||||
@ -90,6 +102,5 @@
|
||||
"\\\\end{exercise}"
|
||||
],
|
||||
"description": "exercise xsim"
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ filetype *.7z
|
||||
fileviewer *.7z 7z l %c
|
||||
|
||||
" Office files
|
||||
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
|
||||
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ods libreoffice %f &
|
||||
fileviewer *.doc catdoc %c
|
||||
fileviewer *.docx docx2txt.pl %f -
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user