Skip to content

Instantly share code, notes, and snippets.

View hsawaji's full-sized avatar

hsawaji

View GitHub Profile
local make_entry = require "telescope.make_entry"
local finders = require "telescope.finders"
local pickers = require "telescope.pickers"
local actions_set = require "telescope.actions.set"
local actions = require('telescope.actions')
local action_state = require "telescope.actions.state"
local utils = require "telescope.utils"
local custom = {}
custom.ctags = function (opts)
@hsawaji
hsawaji / init.vim
Created November 1, 2021 01:15
telescope.nvim settings
lua require("telescope").setup({
\ defaults = {
\ path_display={'smart'},
\ preview=false,
\ border=false,
\ layout_config={
\ prompt_position='bottom',
\ },
\ initial_mode='normal',
\ sorting_strategy='ascending',
@hsawaji
hsawaji / .bash_profiles
Created September 8, 2020 01:54
when file open with `vim` commad in Neovim :terminal, File is opened in parent window and close :terminal
if [[ -n "${NVIM_LISTEN_ADDRESS}" ]]; then
alias vim='nvr -l -c "wincmd p | exit"'
fi
@hsawaji
hsawaji / change_model.vim
Last active August 9, 2018 04:35
moving Entity<->Table for CakePHP
" this script needs the following plugin that change Singularize <-> Pluralize
" NeoBundle 'kyohsuke/sinplu.vim'
" Entity <-> Table for cakePHP
command! -bang ChangeModel call ToggleModel()
function! ChangeModel() abort
let table_path = expand("%:p:h")
let table_file = expand("%:t:r")
if table_path =~# 'Table$'
call s:to_entity()
@hsawaji
hsawaji / fzf_git.vim
Last active August 6, 2018 10:19
fzf_git.vim
" fzf git grep
command! -bang -nargs=+ Gitgrep call s:fzf_git_grep('<args>')
function! s:fzf_git_grep(args) abort
let dir = s:get_git_base_path(expand("%:p:h"))
if dir == -1
echo 'file not found .git'
return
endif
call fzf#run({
\ 'source': 'git grep -n -I -i ' . a:args,
@hsawaji
hsawaji / fzf_git_grep.vim
Last active August 6, 2018 10:22
git grep with fzf on vim
" fzf git grep
command! -bang -nargs=+ Gitgrep call fzf#run({
\ 'source': 'git grep -n -I -i <args>',
\ 'sink': function('s:line_handler'),
\ 'dir': s:get_git_base_path(expand("%:p:h")),
\ 'up': '~40%',
\ 'options': '+m'
\ })
" .gitディレクトリがあるパスを取得する