Compare commits

..

No commits in common. "f796d0775e2d116c2d89dcd9b2170b23359b6a92" and "a3d16cbff22ca36859bc4f966910b3871aae30fa" have entirely different histories.

9 changed files with 70 additions and 146 deletions

View File

@ -38,9 +38,7 @@ local lsp_symbols = {
TypeParameter = "  (TypeParameter)", TypeParameter = "  (TypeParameter)",
} }
local status, cmp = pcall(require, "cmp") local cmp = require'cmp'
if (not status) then return end
cmp.setup{ cmp.setup{
completion = { completion = {
completeopt = 'menuone,noinsert,noselect', completeopt = 'menuone,noinsert,noselect',

View File

@ -1,8 +1,9 @@
local status, autopairs = pcall(require, "nvim-autopairs") local autopairs_status_ok, autopairs = pcall(require, "nvim-autopairs")
if (not status) then return end if not autopairs_status_ok then
return
end
autopairs.setup{ autopairs.setup{
disable_filetype = { "TelescopePrompt" , "vim" }, ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]],"%s+", ""),
ignored_next_char = string.gsub([[ [%w%%%'%[%"%.] ]],"%s+", ""),
} }

View File

@ -1 +0,0 @@
require('gitsigns').setup {}

View File

@ -1,91 +1,46 @@
local status, telescope = pcall(require, "telescope")
if (not status) then return end
local builtin = require("telescope.builtin")
local previewers = require('telescope.previewers') local previewers = require('telescope.previewers')
local Job = require('plenary.job') local Job = require('plenary.job')
local new_maker = function(filepath, bufnr, opts) local new_maker = function(filepath, bufnr, opts)
filepath = vim.fn.expand(filepath) filepath = vim.fn.expand(filepath)
Job:new({ Job:new({
command = 'file', command = 'file',
args = { '--mime-type', '-b', filepath }, args = { '--mime-type', '-b', filepath },
on_exit = function(j) on_exit = function(j)
local mime_type = vim.split(j:result()[1], '/')[1] local mime_type = vim.split(j:result()[1], '/')[1]
if mime_type == "text" then if mime_type == "text" then
previewers.buffer_previewer_maker(filepath, bufnr, opts) previewers.buffer_previewer_maker(filepath, bufnr, opts)
else else
-- maybe we want to write something to the buffer here -- maybe we want to write something to the buffer here
vim.schedule(function() vim.schedule(function()
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { 'BINARY' }) vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { 'BINARY' })
end) end)
end end
end end
}):sync() }):sync()
end end
local fb_actions = require "telescope".extensions.file_browser.actions require('telescope').setup {
local function telescope_buffer_dir() defaults = {
return vim.fn.expand('%:p:h') buffer_previewer_maker = new_maker,
end file_ignore_patterns = {"**/*.pdf"},
},
telescope.setup {
defaults = {
buffer_previewer_maker = new_maker,
file_ignore_patterns = { "**/*.pdf" },
},
extensions = { extensions = {
fzf = { fzf = {
fuzzy = true, -- false will only do exact matching fuzzy = true, -- false will only do exact matching
override_generic_sorter = true, -- override the generic sorter override_generic_sorter = true, -- override the generic sorter
override_file_sorter = true, -- override the file sorter override_file_sorter = true, -- override the file sorter
case_mode = "smart_case", -- or "ignore_case" or "respect_case" case_mode = "smart_case", -- or "ignore_case" or "respect_case"
-- the default case_mode is "smart_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,
},
},
},
}
} }
telescope.load_extension('fzf') require('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)

View File

@ -1,7 +1,4 @@
local status, ts = pcall(require, "nvim-treesitter.configs") require'nvim-treesitter.configs'.setup {
if (not status) then return end
ts.setup {
-- One of "all", "maintained" (parsers with maintainers), or a list of languages -- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = {"python", "css", "html", "lua", "javascript", "vue", "c", "markdown", "rst"}, ensure_installed = {"python", "css", "html", "lua", "javascript", "vue", "c", "markdown", "rst"},
highlight = { highlight = {

View File

@ -56,17 +56,7 @@ end
-- Use a loop to conveniently call 'setup' on multiple servers and -- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches -- map buffer local keybindings when the language server attaches
local servers = { local servers = { "texlab", "pyright", "vuels", "tsserver", "html" }
"texlab",
"pyright",
"vuels",
"tsserver",
"html",
"sumneko_lua",
"ansiblels",
"arduino_language_server",
"clangd",
}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup { nvim_lsp[lsp].setup {
on_attach = on_attach, on_attach = on_attach,

View File

@ -3,16 +3,16 @@ local fn = vim.fn
-- Automatically install packer -- Automatically install packer
local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then if fn.empty(fn.glob(install_path)) > 0 then
PACKER_BOOTSTRAP = fn.system { PACKER_BOOTSTRAP = fn.system {
"git", "git",
"clone", "clone",
"--depth", "--depth",
"1", "1",
"https://github.com/wbthomason/packer.nvim", "https://github.com/wbthomason/packer.nvim",
install_path, install_path,
} }
print "Installing packer close and reopen Neovim..." print "Installing packer close and reopen Neovim..."
vim.cmd [[packadd packer.nvim]] vim.cmd [[packadd packer.nvim]]
end end
-- Autocommand that reloads neovim whenever you save the plugins.lua file -- Autocommand that reloads neovim whenever you save the plugins.lua file
@ -26,16 +26,16 @@ vim.cmd [[
-- Use a protected call so we don't error out on first use -- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, "packer") local status_ok, packer = pcall(require, "packer")
if not status_ok then if not status_ok then
return return
end end
-- Have packer use a popup window -- Have packer use a popup window
packer.init { packer.init {
display = { display = {
open_fn = function() open_fn = function()
return require("packer.util").float { border = "rounded" } return require("packer.util").float { border = "rounded" }
end, end,
}, },
} }
return packer.startup(function(use) return packer.startup(function(use)
@ -50,11 +50,7 @@ return packer.startup(function(use)
} }
use 'tpope/vim-fugitive' 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-surround'
use 'tpope/vim-repeat' use 'tpope/vim-repeat'
@ -76,10 +72,10 @@ return packer.startup(function(use)
-- 'rafamadriz/friendly-snippets', -- 'rafamadriz/friendly-snippets',
}, },
} }
use { 'hrsh7th/cmp-vsnip', after = 'nvim-cmp' } use {'hrsh7th/cmp-vsnip', after = 'nvim-cmp'}
use { 'hrsh7th/cmp-buffer', after = 'nvim-cmp' } use {'hrsh7th/cmp-buffer', after = 'nvim-cmp'}
use { 'hrsh7th/cmp-path', after = 'nvim-cmp' } use {'hrsh7th/cmp-path', after = 'nvim-cmp'}
use { 'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp' } use {'hrsh7th/cmp-nvim-lsp', after = 'nvim-cmp'}
-- use {'f3fora/cmp-spell', after = 'nvim-cmp'} -- use {'f3fora/cmp-spell', after = 'nvim-cmp'}
-- for formatters and linters -- for formatters and linters
@ -93,11 +89,10 @@ return packer.startup(function(use)
use { use {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
config = [[require('config.telescope')]], 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 { use {
'lervag/vimtex', 'lervag/vimtex',
@ -126,7 +121,7 @@ return packer.startup(function(use)
use { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
config = [[require('config.treesitter')]], config=[[require('config.treesitter')]],
run = ':TSUpdate', run = ':TSUpdate',
} }

View File

@ -64,7 +64,6 @@
], ],
"description": "tabular" "description": "tabular"
}, },
"minipage": { "minipage": {
"prefix": "minipage", "prefix": "minipage",
"body": [ "body": [
@ -74,7 +73,6 @@
], ],
"description": "minipage" "description": "minipage"
}, },
"multicols": { "multicols": {
"prefix": "multicols", "prefix": "multicols",
"body": [ "body": [
@ -84,16 +82,6 @@
], ],
"description": "multicols" "description": "multicols"
}, },
"image": {
"prefix": "image",
"body": [
"\\\\includegraphics[scale=${1:1}]{${2:./fig/}}",
"$0"
],
"description": "exercise xsim"
},
"exercise": { "exercise": {
"prefix": "exercise", "prefix": "exercise",
"body": [ "body": [
@ -102,5 +90,6 @@
"\\\\end{exercise}" "\\\\end{exercise}"
], ],
"description": "exercise xsim" "description": "exercise xsim"
} }
} }

View File

@ -332,7 +332,7 @@ filetype *.7z
fileviewer *.7z 7z l %c fileviewer *.7z 7z l %c
" Office files " Office files
filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ods libreoffice %f & filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
fileviewer *.doc catdoc %c fileviewer *.doc catdoc %c
fileviewer *.docx docx2txt.pl %f - fileviewer *.docx docx2txt.pl %f -