and things
This commit is contained in:
@ -22,7 +22,12 @@ if use_google() then
|
|||||||
goog("glaive"),
|
goog("glaive"),
|
||||||
goog("alert"),
|
goog("alert"),
|
||||||
goog("csearch"),
|
goog("csearch"),
|
||||||
goog("codefmt"),
|
goog(
|
||||||
|
"codefmt",
|
||||||
|
function()
|
||||||
|
vim.cmd([[Glaive codefmt ktfmt_executable=`["/google/bin/releases/kotlin-google-eng/ktfmt/ktfmt_deploy.jar", "--google-style"]`]])
|
||||||
|
end
|
||||||
|
),
|
||||||
goog("codefmt-google"),
|
goog("codefmt-google"),
|
||||||
goog("languages"),
|
goog("languages"),
|
||||||
goog("googlestyle"),
|
goog("googlestyle"),
|
||||||
@ -203,8 +208,7 @@ augroup autoformat_settings
|
|||||||
autocmd FileType textpb AutoFormatBuffer text-proto-format
|
autocmd FileType textpb AutoFormatBuffer text-proto-format
|
||||||
autocmd FileType proto AutoFormatBuffer protofmt
|
autocmd FileType proto AutoFormatBuffer protofmt
|
||||||
autocmd FileType sql AutoFormatBuffer format_sql
|
autocmd FileType sql AutoFormatBuffer format_sql
|
||||||
autocmd FileType kotlin AutoFormatBuffer google-java-format
|
autocmd FileType kotlin AutoFormatBuffer ktfmt
|
||||||
-- autocmd FileType kotlin AutoFormatBuffer ktfmt
|
|
||||||
" autocmd FileType html,css,json AutoFormatBuffer js-beautify
|
" autocmd FileType html,css,json AutoFormatBuffer js-beautify
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
-- Imports the plugin's additional Lua modules.
|
|
||||||
-- local fetch = require("example-plugin.fetch")
|
|
||||||
-- local update = require("example-plugin.update")
|
|
||||||
|
|
||||||
-- Creates an object for the module. All of the module's
|
|
||||||
-- functions are associated with this object, which is
|
|
||||||
-- returned when the module is called with `require`.
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
-- Routes calls made to this module to functions in the
|
|
||||||
-- plugin's other modules.
|
|
||||||
-- M.fetch_todos = fetch.fetch_todos
|
|
||||||
-- M.insert_todo = update.insert_todo
|
|
||||||
-- M.complete_todo = update.complete_todo
|
|
||||||
|
|
||||||
function M.setup()
|
|
||||||
vim.api.nvim_create_user_command('CritiqueHelloWorld', M.hello_world, {})
|
|
||||||
-- vim.api.nvim_create_user_command('CritiqueOpenTree', M.open_window, {})
|
|
||||||
end
|
|
||||||
|
|
||||||
local buf, win
|
|
||||||
|
|
||||||
function M.hello_world()
|
|
||||||
vim.notify("HELLO WORLD!!!")
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.open_window()
|
|
||||||
buf = vim.api.nvim_create_buf(false, true) -- create new emtpy buffer
|
|
||||||
|
|
||||||
vim.api.nvim_buf_set_option(buf, 'bufhidden', 'wipe')
|
|
||||||
|
|
||||||
-- get dimensions
|
|
||||||
local width = vim.api.nvim_get_option("columns")
|
|
||||||
local height = vim.api.nvim_get_option("lines")
|
|
||||||
|
|
||||||
-- calculate our floating window size
|
|
||||||
local win_height = math.ceil(height * 0.8 - 4)
|
|
||||||
local win_width = math.ceil(width * 0.8)
|
|
||||||
|
|
||||||
-- and its starting position
|
|
||||||
local row = math.ceil((height - win_height) / 2 - 1)
|
|
||||||
local col = math.ceil((width - win_width) / 2)
|
|
||||||
|
|
||||||
-- set some options
|
|
||||||
local opts = {
|
|
||||||
style = "minimal",
|
|
||||||
relative = "editor",
|
|
||||||
width = win_width,
|
|
||||||
height = win_height,
|
|
||||||
row = row,
|
|
||||||
col = col
|
|
||||||
}
|
|
||||||
|
|
||||||
-- and finally create it with buffer attached
|
|
||||||
win = vim.api.nvim_open_win(buf, true, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function update_view()
|
|
||||||
-- we will use vim systemlist function which run shell
|
|
||||||
-- command and return result as list
|
|
||||||
local result = vim.fn.systemlist('hg xl')
|
|
||||||
|
|
||||||
-- with small indentation results will look better
|
|
||||||
for k,v in pairs(result) do
|
|
||||||
result[k] = ' '..result[k]
|
|
||||||
end
|
|
||||||
|
|
||||||
api.nvim_buf_set_lines(buf, 0, -1, false, {
|
|
||||||
center('Critique'),
|
|
||||||
''
|
|
||||||
})
|
|
||||||
|
|
||||||
api.nvim_buf_set_lines(buf, 0, -1, false, result)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function center(str)
|
|
||||||
local width = api.nvim_win_get_width(0)
|
|
||||||
local shift = math.floor(width / 2) - math.floor(string.len(str) / 2)
|
|
||||||
return string.rep(' ', shift) .. str
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
@ -1,15 +0,0 @@
|
|||||||
" perl plugins
|
|
||||||
|
|
||||||
|
|
||||||
" node plugins
|
|
||||||
|
|
||||||
|
|
||||||
" python3 plugins
|
|
||||||
|
|
||||||
|
|
||||||
" ruby plugins
|
|
||||||
|
|
||||||
|
|
||||||
" python plugins
|
|
||||||
|
|
||||||
|
|
@ -189,7 +189,3 @@ endfun
|
|||||||
|
|
||||||
filetype plugin indent on
|
filetype plugin indent on
|
||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
if filereadable(expand("~/use_google"))
|
|
||||||
source ~/.vim/prefs/google.vim
|
|
||||||
endif
|
|
||||||
|
Reference in New Issue
Block a user