コード例 #1
0
ファイル: base.py プロジェクト: thebaum/iron.nvim
    def _fill_in_detect_key(repls):
        """Fill in missing "detect" keys in the available_repls list

        This will only work correctly if the only thing that needs to be
        detected is the command given in the 'command' key.  For more complex
        cases the detect key has to be given explicitly.
        """
        for repl in repls:
            if 'detect' not in repl:
                new = repl.copy()
                new['detect'] = detect_fn(shlex.split(repl['command'])[0])
                yield new
            else:
                yield repl
コード例 #2
0
ファイル: scala.py プロジェクト: Alok/iron.nvim-1
def sbt_test_this_file(iron):
    data = "test {}.{}".format(get_ns(iron), get_class(iron))
    return iron.send_to_repl((data, "sbt.scala"))


mappings = [
    ('<leader>sa', 'import_all', scala_import_all_ns),
    ('<leader>si', 'import', scala_import),
    ('<leader>sb', 'block', scala_send_block),
    ('<leader>sl', 'line', scala_send_line),
]

sbt_file = {
    'command': 'sbt',
    'language': 'sbt.scala',
    'detect': detect_fn('sbt'),
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}

sbt_cmd = {
    'command': 'sbt',
    'language': 'scala',
    'detect': detect_fn('sbt', ['build.sbt', 'project/build.sbt']),
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}

scala = {
    'command': 'scala',
    'language': 'scala',
コード例 #3
0
# encoding:utf-8
"""Node repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'node',
    'language': 'javascript',
    'detect': detect_fn('node')
}
コード例 #4
0
    ('<leader>si', 'import', scala_import),
    ('<leader>sb', 'block', scala_send_block),
    ('<leader>sl', 'line', scala_send_line),
]

sbt_file = {
    'command': 'sbt',
    'language': 'sbt.scala',
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}

sbt_cmd = {
    'command': 'sbt',
    'language': 'scala',
    'detect': detect_fn('sbt', ['build.sbt', 'project/build.sbt']),
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}

scala = {
    'command': 'scala',
    'language': 'scala',
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}

def do_stuff():
    nvim.command("2 wincmd w")
    nvim.command("""global/get_ns/normal! 0f "Gyt(""")
    return nvim.funcs.getreg("g")
コード例 #5
0
# encoding:utf-8
"""Haskell repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

ghci = {
    'command': 'ghci',
    'language': 'haskell',
    'detect': detect_fn('ghci'),
}

stackghci = {
    'command': 'stack ghci',
    'language': 'haskell',
    'detect': detect_fn('stack'),
}
コード例 #6
0
# encoding:utf-8
"""OCaml repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

ocamltop = {
    'command': 'ocamltop',
    'language': 'ocaml',
    'detect': detect_fn('ocamltop')
}

utop = {
    'command': 'utop',
    'language': 'ocaml',
    'detect': detect_fn('utop')
}
コード例 #7
0
# encoding:utf-8
"""Scheme repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {'command': 'guile', 'language': 'scheme', 'detect': detect_fn('guile')}
コード例 #8
0
ファイル: __init__.py プロジェクト: lucc/iron.nvim
    ('<leader>si', 'import', lein_import),
    ('<leader>sn', 'switch-ns', lein_switch_ns),
    ('<leader>sr', 'require-file', lein_require_file),
    ('<leader>sR', 'require-with-ns', lein_require_with_ns),
    ('<leader>s.', 'prompt-require', lein_prompt_require),
    ('<leader>s/', 'prompt-require-as', lein_prompt_require_as),
    ('<leader>ss', 'send-block', lein_send),
    ('<leader>mf', 'midje-load-facts', midje_load_facts),
    ('<leader>ma', 'midje-autotest', midje_autotest),
]

repl = {
    'command': 'lein repl',
    'language': 'clojure',
    'priority': 0,
    'detect': detect_fn('lein'),
    'mappings': mappings
}

connect = {
    'command': 'lein repl :connect',
    'language': 'clojure',
    'priority': 10,
    'detect': detect_fn('lein', ['.nrepl-port']),
    'mappings': mappings
}

boot = {
    'command': 'boot repl',
    'language': 'clojure',
    'priority': 0,
コード例 #9
0
ファイル: r.py プロジェクト: Alok/iron.nvim-1
# encoding:utf-8
"""R repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'R',
    'language': 'r',
    'detect': detect_fn('R')
}
コード例 #10
0
ファイル: sh.py プロジェクト: Alok/iron.nvim-1
def prompt_cmd(iron):
    try:
        cmd = iron.prompt("command")
    except:
        iron.call_cmd("echo 'Aborting'")
    else:
        return iron.send_to_repl((cmd, "sh"))

global_mappings = [
    ('<leader>sx', 'prompt_cmd', prompt_cmd),
]

zsh_sh = {
    'command': 'zsh',
    'language': 'sh',
    'detect': detect_fn('zsh'),
    'global_mappings': global_mappings,
}

zsh_zsh = {
    'command': 'zsh',
    'language': 'zsh',
    'detect': detect_fn('zsh'),
}

bash_sh = {
    'command': 'bash',
    'language': 'sh',
    'detect': detect_fn('bash'),
    'global_mappings': global_mappings,
}
コード例 #11
0
ファイル: scheme.py プロジェクト: lucc/iron.nvim
# encoding:utf-8
"""Scheme repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

guile = {
    'command': 'guile',
    'language': 'scheme',
    'detect': detect_fn('guile')
}

chicken = {'command': 'csi', 'language': 'scheme', 'detect': detect_fn('csi')}
コード例 #12
0
ファイル: elm.py プロジェクト: Alok/iron.nvim-1
# encoding:utf-8
"""Elm repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'elm-repl',
    'language': 'elm',
    'detect': detect_fn('elm-repl'),
    'multiline' : ('', '', '\n', '\\\n')
}
コード例 #13
0
# encoding:utf-8
"""Ruby repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'irb',
    'language': 'ruby',
    'detect': detect_fn('irb')
}
コード例 #14
0
    try:
        cmd = iron.prompt("command")
    except:
        iron.call_cmd("echo 'Aborting'")
    else:
        return iron.send_to_repl((cmd, "sh"))


global_mappings = [
    ('<leader>sx', 'prompt_cmd', prompt_cmd),
]

zsh_sh = {
    'command': 'zsh',
    'language': 'sh',
    'detect': detect_fn('zsh'),
    'global_mappings': global_mappings,
}

zsh_zsh = {
    'command': 'zsh',
    'language': 'zsh',
    'detect': detect_fn('zsh'),
}

bash_sh = {
    'command': 'bash',
    'language': 'sh',
    'detect': detect_fn('bash'),
    'global_mappings': global_mappings,
}
コード例 #15
0
ファイル: __init__.py プロジェクト: Alok/iron.nvim-1
    ('<leader>sn', 'switch-ns', lein_switch_ns),
    ('<leader>sr', 'require-file', lein_require_file),
    ('<leader>sR', 'require-with-ns', lein_require_with_ns),
    ('<leader>s.', 'prompt-require', lein_prompt_require),
    ('<leader>s/', 'prompt-require-as', lein_prompt_require_as),
    ('<leader>ss', 'send-block', lein_send),

    ('<leader>mf', 'midje-load-facts', midje_load_facts),
    ('<leader>ma', 'midje-autotest', midje_autotest),
]

repl = {
    'command': 'lein repl',
    'language': 'clojure',
    'priority': 0,
    'detect': detect_fn('lein'),
    'mappings': mappings
}

connect = {
    'command': 'lein repl :connect',
    'language': 'clojure',
    'priority': 10,
    'detect': detect_fn('lein', ['.nrepl-port']),
    'mappings': mappings
}

boot = {
    'command': 'boot repl',
    'language': 'clojure',
    'priority': 0,
コード例 #16
0
ファイル: haskell.py プロジェクト: lucc/iron.nvim
# encoding:utf-8
"""Haskell repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

ghci = {
    'command': 'ghci',
    'language': 'haskell',
    'detect': detect_fn('ghci'),
}

stackghci = {
    'command': 'stack ghci',
    'language': 'haskell',
    'detect': detect_fn('stack'),
}

intero = {
    'command': 'stack ghci --with-ghc intero',
    'language': 'haskell',
    'detect': detect_fn('intero'),
}
コード例 #17
0
# encoding:utf-8
"""Elixir repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'iex',
    'language': 'elixir',
    'detect': detect_fn('iex'),
}
コード例 #18
0
# encoding:utf-8
"""TCL repl definitions"""
from iron.repls.utils.cmd import detect_fn

repl = {'command': 'tclsh', 'language': 'tcl', 'detect': detect_fn("tclsh")}
コード例 #19
0
# encoding:utf-8
"""Lua repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'lua',
    'language': 'lua',
    'detect': detect_fn('lua')
}
コード例 #20
0

def set_pdb(iron):
    iron.send_to_repl("pdb")



mappings = [
    ('<leader>pp', 'set_pdb', set_pdb),
]


python = {
    'command': 'python',
    'language': 'python',
    'detect': detect_fn('python'),
}

ipython = {
    'command':   'ipython',
    'language':  'python',
    'multiline': ('\x1b[200~', '\x1b[201~', '\r'),
    'detect': detect_fn('ipython'),
}


ptpython = {
    'command': 'ptpython',
    'language': 'python',
    'multiline': ('\x1b[200~', '\x1b[201~', '\r'),
    'detect': detect_fn('ptpython'),
コード例 #21
0
# encoding:utf-8
"""Pure-lang repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

def pure_send_block(iron):
    iron.call_cmd("""normal! Vi{"sy""")
    data = "{}".format(iron.register('s'))
    return iron.send_to_repl((data, "pure"))

def pure_send_line(iron):
    iron.call_cmd("""normal! 0"sy$""")
    data = "{}".format(iron.register('s'))
    return iron.send_to_repl((data, "pure"))

mappings = [
    ('<leader>sb', 'block', pure_send_block),
    ('<leader>sl', 'line', pure_send_line),
]

repl = {
    'command': 'pure',
    'language': 'pure',
    'detect': detect_fn('pure'),
    'mappings': mappings,
    'multiline': (':paste\n', '\x04'),
}
コード例 #22
0
# encoding:utf-8
"""Elm repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'elm-repl',
    'language': 'elm',
    'detect': detect_fn('elm-repl')
}
コード例 #23
0
# encoding:utf-8
"""Erlang repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'erl',
    'language': 'erlang',
    'detect': detect_fn('erl'),
}
コード例 #24
0
ファイル: php.py プロジェクト: xiamaz/iron.nvim
# encoding:utf-8
"""PHP repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

php = {
    'command': 'php -a',
    'language': 'php',
    'detect': detect_fn('php'),
}

psyshell = {
    'command': 'psysh',
    'language': 'php',
    'detect': detect_fn('psysh'),
}
コード例 #25
0
ファイル: haskell.py プロジェクト: xiamaz/iron.nvim
# encoding:utf-8
"""Haskell repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

ghci = {
    'command': 'ghci',
    'language': 'haskell',
}

stackghci = {
    'command': 'stack ghci',
    'language': 'haskell',
}

intero = {
    'command': 'stack ghci --with-ghc intero',
    'language': 'haskell',
    'detect': detect_fn('intero'),
}
コード例 #26
0
# encoding:utf-8
"""R repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {'command': 'R', 'language': 'r', 'detect': detect_fn('R')}
コード例 #27
0
# encoding:utf-8
"""Lisp repl definition for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

sbcl = {
    'command': 'sbcl',
    'language': 'lisp',
    'detect': detect_fn('sbcl')
}

clisp = {
    'command': 'clisp',
    'language': 'lisp',
    'detect': detect_fn('clisp')
}
コード例 #28
0
ファイル: python.py プロジェクト: mtikekar/iron.nvim
    iron.send_to_repl("pdb")


mappings = [
    ('<leader>pp', 'set_pdb', set_pdb),
]

python = {
    'command': 'python',
    'language': 'python',
}

ipython = {
    'command': 'ipython',
    'language': 'python',
    'multiline': ('\x1b[200~', '\x1b[201~', '\r'),
}

ptpython = {
    'command': 'ptpython',
    'language': 'python',
    'multiline': ('\x1b[200~', '\x1b[201~', '\r'),
}

ptipython = {
    'command': 'ptipython',
    'language': 'python',
    'multiline': ('\x1b[200~', '\x1b[201~', '\r'),
    'detect': detect_fn(['ptipython', 'ipython']),
}
コード例 #29
0
# encoding:utf-8
"""Scheme repl definitions for iron.nvim. """
from iron.repls.utils.cmd import detect_fn

repl = {
    'command': 'racket',
    'language': 'racket',
    'detect': detect_fn('racket')
}