Skip to content
Snippets Groups Projects
Commit 7e419974 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Initial pass at learning vim's python interface.

parents
No related branches found
No related tags found
No related merge requests found
.*.swp
*.pyc
" cobol.vim - Some useful COBOL scripts.
" Maintainer: Kevin Lyda <kevin@phrye.com>
" Version: 0.1
" TODO: add vim-scripts config
if exists('g:loaded_cobol') || &cp
echo "Already loaded."
finish
endif
let g:loaded_cobol = 1
if !has('python3')
echo "Missing python."
finish
endif
let s:path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
function! HelloWorld()
exec 'py3file ' . s:path . '/renumber.py'
endfunction
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 Kevin Lyda <kevin@phrye.com>
#
# Distributed under terms of the GPL license.
"""
COBOL utilities.
"""
import vim
print(vim.current.buffer.name)
b = vim.current.buffer
for i in range(len(b)):
b[i] = 'moo ' + b[i]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment