F2MVE4TY5BDP4DULREZSJVPB4GEGV72LASYSMUDBQQO56NSV7ZXAC
736ULOPNTH26YEXM5HWM2J4XZPXC52IGKQH5ARAS5ID55B4253QAC
NID74IBESPTJUVIH7G6VBVJXUY7GBX654AMIG2MWFHFRMI7RZXAQC
XWDYSQGRZY2ALY4IS7RJNLNDAKKTLSPMHJTRNQ4NAPVTCCVQOKRAC
GGKSPLOM4NMOFIKWY5DUIYUL7QFU4UQ54GWS2ER7Z3R3YW4SKVRQC
WJJ3NYDZDHTDVSU6FT7JKWATKX3S6ES5KU3BB7TXN5U7PV4RC5TAC
UCC6KWKXYJSZHLJ67RWHPOXBOI3PUHD6RXOW5ZP574WAEJE4BONAC
EQIYV4GQF2HJB6AGRGBCSBZSETC7EZ2SOZOMYFRNNN7RODZ5EQ3QC
vim.g.coc_global_extensions = { 'coc-omnisharp', 'coc-rust-analyzer', 'coc-go', 'coc-actions', 'coc-emmet', 'coc-css', 'coc-tsserver', 'coc-prettier', 'coc-deno','coc-html', 'coc-eslint'}
vim.g.coc_global_extensions = { 'coc-omnisharp', 'coc-rust-analyzer', 'coc-go', 'coc-actions', 'coc-emmet', 'coc-css', 'coc-tsserver', 'coc-prettier', 'coc-deno','coc-html', 'coc-eslint', 'coc-texlab'}
end
-- Makes a window and returns it's buffer.
local make_window = function(width, height, x, y, style, relative)
local buf = vim.api.nvim_create_buf(false, true)
local opts = {
style = style,
relative = relative,
width = width,
height = height,
row = x,
col = y
}
local win = vim.api.nvim_open_win(buf, true, opts)
return buf
end
--Opens a terminal in a floating window.
local OpenTerminal = function()
local width = vim.api.nvim_get_option("columns")
local height = vim.api.nvim_get_option("lines")
local win_height = math.ceil(height * 0.8)
local win_width = math.ceil(width * 0.8)
local col_pos = math.floor(width * 0.1)
local row_pos = math.floor(height * 0.1)
local buffer = make_window(win_width, win_height, row_pos, col_pos, "minimal", "editor")
vim.api.nvim_command('term')
--keybindings
vimp.nnoremap({'silent'}, '<c-n>', OpenTerminal)
vimp.bind('ni','<A-h>', function() vim.cmd(':wincmd h') end)
vimp.bind('ni','<A-j>', function() vim.cmd(':wincmd j') end)
vimp.bind('ni','<A-k>', function() vim.cmd(':wincmd k') end)
vimp.bind('ni','<A-l>', function() vim.cmd(':wincmd l') end)
vimp.bind('n', 'gd<Plug>', '(coc-definition)' )
vimp.bind('n', 'gy<Plug>', '(coc-type-definition)')
--keybindings (would love to get vimp working)
vim.api.nvim_set_keymap('', '<c-n>', ':lua require(\'plugins/Terminal\').open(0.8, 0.8) <CR>', {silent = true})
vim.api.nvim_set_keymap('', '<c-t>', ':lua require(\'plugins/FZF\').open(\'vert new\', 0.8, 0.8) <CR>', {silent = true})
vim.api.nvim_set_keymap('', '<c-r>', ':lua require(\'plugins/FZF\').open(\'e\', 0.8, 0.8) <CR>', {silent = true})
vim.api.nvim_set_keymap('', '<A-h>', ':wincmd h <CR>', {})
vim.api.nvim_set_keymap('', '<A-j>', ':wincmd j <CR>', {})
vim.api.nvim_set_keymap('', '<A-k>', ':wincmd k <CR>', {})
vim.api.nvim_set_keymap('', '<A-l>', ':wincmd l <CR>', {})
vim.api.nvim_set_keymap('n', 'gd', 'CocActionAsync(\'jumpDefinition\')', {})
--Make a new fzf window.
local OpenFZF = function(action, size_x_percent, size_y_percent)
--vim.g.fzf_colors = {
-- ["fg"]= {'fg', 'Normal'},
-- ["bg"]= {'bg', 'Normal'},
-- ["hl"]= {'fg', 'Comment'},
-- ["fg+"]= {'fg', 'CursorLine', 'CursorColumn', 'Normal'},
-- ["bg+"]= {'bg', 'CursorLine', 'CursorColumn'},
-- ["hl+"]= {'fg', 'Statement'},
-- ["info"]= {'fg', 'PreProc'},
-- ["border"]= {'fg', 'Ignore'},
-- ["prompt"]= {'fg', 'Conditional'},
-- ["pointer"]= {'fg', 'Exception'},
-- ["marker"]= {'fg', 'Keyword'},
-- ["spinner"]= {'fg', 'Label'},
-- ["header"]= {'fg', 'Comment'}
--}
local cmd = ":call fzf#run(fzf#wrap({"..
string.format("'sink': '%s',", action)..
"'source': 'rg --files',"..
[['options': '--preview-window=50% --preview="bat {} --color=always --style=plain"',]]..
string.format("'window': {'width': %f, 'height': %f, 'border': 'no'},", size_x_percent, size_y_percent)..
"}))"
vim.api.nvim_command(cmd)
end
local r = {
open = function(action, x, y) OpenFZF(action, x, y) end
}
return r
--Opens a terminal in a floating window.
local OpenTerminal = function(size_x_percent, size_y_percent)
local utils = require('plugins/utils')
local width = vim.api.nvim_get_option("columns")
local height = vim.api.nvim_get_option("lines")
local win_height = math.ceil(height * size_x_percent)
local win_width = math.ceil(width * size_y_percent)
local col_pos = math.floor(width * (1-size_y_percent)/2)
local row_pos = math.floor(height * (1-size_x_percent)/2)
local buffer = utils.make_window(win_width, win_height, row_pos, col_pos, "minimal", "editor")
vim.api.nvim_command('term')
end
local r = {
-- Takes a x and y as percentage size of the screen.
open = function(x, y) OpenTerminal(x, y) end
}
return r
local r = {
-- Makes a window and returns it's buffer.
make_window = function(width, height, x, y, style, relative)
local buf = vim.api.nvim_create_buf(false, true)
local opts = {
style = style,
relative = relative,
width = width,
height = height,
row = x,
col = y
}
local win = vim.api.nvim_open_win(buf, true, opts)
return buf
end
}
return r