Compare commits
4 Commits
12fd83dd6e
...
85d1ee1391
Author | SHA1 | Date |
---|---|---|
David JULIEN | 85d1ee1391 | |
David JULIEN | 03ae7cfce3 | |
David JULIEN | c7b3fc1851 | |
David JULIEN | 2737cfc4a2 |
|
@ -24,3 +24,4 @@ utils.map("n", "<leader>lf", "<cmd>lua vim.lsp.buf.formatting()<CR>")
|
|||
-- telescope
|
||||
utils.map("n", "<leader>tf", "<cmd>Telescope find_files<CR>")
|
||||
utils.map("n", "<leader>tb", "<cmd>Telescope file_browser<CR>")
|
||||
utils.map("n", "<leader>tl", "<cmd>Telescope live_grep<CR>")
|
||||
|
|
|
@ -3,55 +3,55 @@
|
|||
-- License : GPLv3
|
||||
-- Description : neovim settings file
|
||||
|
||||
local g = vim.g
|
||||
|
||||
local o = vim.o
|
||||
local w = vim.wo
|
||||
local b = vim.bo
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
-- general
|
||||
o.wildignore = [[
|
||||
.git
|
||||
*.o,*.class
|
||||
*.jpg,*.jpeg,*.png
|
||||
*.avi,*.mp4,*.mkv
|
||||
*.mp3,*.ogg,*.flac
|
||||
*.eot,*.otf,*.ttf,*.woff
|
||||
*.pdf
|
||||
*.zip,*.gz,*.rar,*.tar.xz
|
||||
]]
|
||||
o.wildmode = "longest,full"
|
||||
o.wildoptions = "pum"
|
||||
g.netrw_dirhistmax = 0
|
||||
opt.wildignore = {
|
||||
".git",
|
||||
"*.o", "*.class",
|
||||
"*.jpg", "*.jpeg", "*.png",
|
||||
"*.pdf",
|
||||
"*.zip", "*.gz", "*.rar", "*.tar.xz",
|
||||
}
|
||||
opt.wildmode = { "longest", "full" }
|
||||
opt.wildoptions = "pum"
|
||||
g.loaded_netrw = 1 -- disable netrw
|
||||
|
||||
-- editor
|
||||
o.splitright = true
|
||||
o.splitbelow = true
|
||||
o.scrolloff = 4
|
||||
o.termguicolors = true
|
||||
o.background = "dark"
|
||||
o.shortmess = o.shortmess .. "c"
|
||||
w.number = true
|
||||
w.relativenumber = true
|
||||
w.signcolumn = "yes"
|
||||
o.listchars = "tab:<->,nbsp:␣,trail:·,extends:>,precedes:<"
|
||||
o.showmatch = true
|
||||
o.ignorecase = true
|
||||
o.smartcase = true
|
||||
o.inccommand = "split"
|
||||
o.completeopt = "menuone,noselect"
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
opt.scrolloff = 4
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
opt.shortmess = opt.shortmess:append { c = true }
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.signcolumn = "yes"
|
||||
opt.listchars = {
|
||||
tab = "<->",
|
||||
nbsp = "␣",
|
||||
trail = "·",
|
||||
extends = ">",
|
||||
precedes = "<",
|
||||
}
|
||||
opt.showmatch = true
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.inccommand = "split"
|
||||
opt.completeopt = { "menuone", "noselect" }
|
||||
|
||||
-- statusline
|
||||
o.laststatus = 2
|
||||
o.showmode = false
|
||||
opt.laststatus = 2
|
||||
opt.showmode = false
|
||||
|
||||
-- text, tabs, indents
|
||||
b.textwidth = 79
|
||||
b.shiftwidth = 8
|
||||
b.softtabstop = -1
|
||||
b.expandtab = true
|
||||
b.shiftwidth = 0
|
||||
o.backspace = "indent,eol,start"
|
||||
opt.textwidth = 79
|
||||
opt.shiftwidth = 8
|
||||
opt.softtabstop = -1
|
||||
opt.expandtab = true
|
||||
opt.shiftwidth = 0
|
||||
opt.backspace = { "indent", "eol", "start" }
|
||||
|
||||
-- augroups
|
||||
utils.create_augroup({
|
||||
|
|
|
@ -98,15 +98,6 @@ local function get_mode_color(m)
|
|||
return color[m]
|
||||
end
|
||||
|
||||
-- don't return a filename that's too long
|
||||
local function filename()
|
||||
if vim.api.nvim_win_get_width(0) > 80 then
|
||||
return "%F"
|
||||
else
|
||||
return "%t"
|
||||
end
|
||||
end
|
||||
|
||||
-- from https://github.com/nvim-lua/lsp-status.nvim/blob/master/lua/lsp-status/diagnostics.lua
|
||||
local function get_lsp_diagnostics(bufnr)
|
||||
local result = {}
|
||||
|
@ -149,7 +140,7 @@ local function statusline_focused()
|
|||
|
||||
local left = table.concat {
|
||||
gen_section(accent_color, {get_mode_display_name(mg)}),
|
||||
gen_section("%#Middle#", {filename()}),
|
||||
gen_section("%#Middle#", {"%f"}),
|
||||
gen_section("%#Bottom#", {"%m", "%r"}),
|
||||
gen_section(
|
||||
"%#Alert#",
|
||||
|
@ -195,7 +186,7 @@ end
|
|||
|
||||
local function statusline_not_focused()
|
||||
return table.concat {
|
||||
gen_section("%#StatuslineNF#", {filename(), "%m"}),
|
||||
gen_section("%#StatuslineNF#", {"%f", "%m"}),
|
||||
"%=",
|
||||
gen_section("%#StatuslineNF#", {"%03.p%%"}),
|
||||
gen_section("%#StatuslineNF#", {"-%03.c-"})
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibshow] which bibliography?")" # the -not -path allows find to ignore hidden files
|
||||
|
||||
refs_list="$(sed -e 's/\t//g' "$file" | tr '\n' ' ' | sed -e 's/}\s\s/}\n/g')"
|
||||
[ -z $refs_list ] && exit 1;
|
||||
[ -z "$refs_list" ] && exit 1;
|
||||
|
||||
ref="$(printf "$refs_list" | dmenu -i -p 'reference?' -l 10)"
|
||||
[ -z $ref ] && exit 1;
|
||||
[ -z "$ref" ] && exit 1;
|
||||
|
||||
output="$(printf "$ref" | sed -e 's/author/\n author/g' -e 's/",/",\n/g')"
|
||||
|
||||
printf "$output" | dmenu -i -p "infos" -l 10
|
||||
printf "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | xclip -selection clipboard
|
||||
printf "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | tr -d '\n' | xclip -selection clipboard
|
||||
|
|
Reference in New Issue